V. DATAform database interface
124
Developer handbook DATAformXTension © 1992-2004 www.gassenhuber.de
The three methods of the core interface
DX_Write
DX_Write (Selector; {path}) => Boolean
The DX_Write function serves to transfer objects to QuarkXPress. The transfer can be done via
the clipboard or via a file. When importing into QuarkXPress, the DATAformXTension has to
be set to import from the clipboard or from a file. (See under DATAformXTension Prefer-
ences....)
The transfer of objects follows, in general, this coding scheme:
DX_Write (0;{path})
`initialise the interface
Loop through the export records
Fill the DX_Arrays with the values of a box
DX_Write (1)
`Transfer the filled DX_Array to the interface
Load next record
End of loop
DX_Write (2)
`Transfer all collected objects to QuarkXPress.
The DX_DemoWrite procedure shows the procedure.
The calls must occur in the order 0, 1, 2.
DX_Write returns True if no error occurred. The variable "DX_Error" becomes 0.
DX_Write returns False if an error occurred. The error number is then written into the variable
DX_Error.
DX_Write (0;{path}) => Boolean
Initialises the text array DX_Array.
If a path is transferred, the file is created and opened. If the path is missing, the clipboard will
be used.
DX_Write (1) => Boolean
Transfers the DX_Array (the object) to the interface. The interface translates the object into
DATAformTags and places it in a buffer.
If a DX_Array line begins with *, the line is transferred as it is without translation, cf.
DX_Read {3}.
DX_Array{1} and DX_Blob
The text/picture path of the box is usually transferred to DX_Array{1}.
With chained boxes the entire text of the chain must be transferred with the first box.
This may lead to large texts that extend over the 30K limit for DX_Array{1}. In this case the
whole text should be transferred to the Blob DX_Blob.
Many texts are added as shown in the following scheme:
At the end a DX_Write {1} follows for the entire text of the box.
Per DX_Write(1) you can switch between the transfer to DX_Array{1} and DX_Blob. If the
blob contains data, its data will be used and not the data in the DX_Array{1}. The blob will
then be written into the file by DX_Write{1} and reset to zero.
If you work with DX_Blob, the data will not be collected anymore, but written straight away
into the file. With small text quantities and picture paths it is better to fill the DX_Array{1} in
order to reduce hard drive access.