V. DATAform database interface
126
Developer handbook DATAformXTension © 1992-2004 www.gassenhuber.de
DX_Read
DX_Read (Selector; {path}) => Boolean
The reading of text with DATAformTags is structured as follows:
DX_Read (0;{path})
`Open updating file
While (DX_Read (1))
`Read object and fill the DX_Array
Search for the corresponding record by the object No. in DX_Array{2}
Update/create/skip the record
Save record
End while
`End of loop
The procedure DX_DemoRead demonstrates the procedure.
DX_Read (0;{path}) => Boolean
Starts a read procedure. If a path is specified, the file will be opened. The validity of the path
should be checked before transfer. If the path is missing, the open file dialogue appears and
you may choose an update file from there.
DX_Read returns True if an appropriate document has been opened, otherwise False and an
error number in DX_Error.
DX_Read (1) => Boolean
Reads an object from a document that has been successfully opened by DX_Read {0}. The
object will be read into the Array DX_Array.
DX_Read returns True if successfully read otherwise False and an error number in DX_Error.
DX_Read (1) is usually called repeatedly until all objects will have been read.
If the end of the document is reached, DX_Read {1} returns False, the document is closed, the
DX_Array is erased, the variable DX_Error is set to 20004.
DX_Read (2) => True
Closes a document. This call is necessary only if the read procedure should be interrupted. It
always returns True.
DX_Read (3) => Boolean
Reads an object like {1}, but only the first 10 plus a further 6 lines of the Array will be filled
with the values. The remaining Tags are not read as values, but are placed as a text with
DATAformTags in DX_Array{11}. With this method most of the object properties are
received as a text and can be saved in a text field as a block of text.
With your following transfer to QuarkXPress you fill the line {11} with the complete text
again. DX_Write {1} transfers the text unchanged as it starts with *, cf. DX_Write {1}.
By DX_Read {3} the first 10 lines of the Array will be filled and additionally:
{28} *F Font mode; if line {28} = "2", the text includes XPressTags.
{63} *+ Section page <=, delivers the section page on which the box is placed.
{64} *» Chain: next box
{65} *« Chain: previous box
{66} *A Anchor in box
{71} *@ Character set table
The remaining exported Tags are written as DATAformTags text in the Array line
DX_Array{11}.