V. DATAform database interface
127
Developer handbook DATAformXTension © 1992-2004 www.gassenhuber.de
DX_Read (4) => Boolean
Allows you to choose for every single DATAformTag whether it should be written into the
DX_Array or added as text to DX_Array{11}. For this you write a string in DX_Array{0}
composed by Char (desired DX_Array line).
DX_Read (4) only reads these DX_Array {0} parameters into the DX_Array. All others in
DX_Array {11}.
Example for DX_Read (4)
DX_Array{0}:=Char(1)+Char(2)+Char(3)+Char(4)+Char(5)+Char(6)+Char(7)
DX_Array{0}:=DX_Array{0}+Char(8)+Char(9)+Char(10)+Char(28)+Char(63)
DX_Array{0}:=DX_Array{0}+Char(64)+Char(65)+Char(66)+Char(71)+Char(73)
If you fill DX_Array{0} with this string, DX_Read {4} behaves identically to DX_Read {3}:
Only parameters 1-10, 28, 63-66 and 71, 73 will be read in their DX_Array line. All others in
DX_Array {11}.
By adding or erasing a parameter in the list you can define individually whether the parameter
should be transferred as an Array line or as text in DX_Array {11}.
In this way can e.g. also the anchoring information be saved in one text together with other box
properties or in specific, separate fields.
DX_Buffer for DX_Read
The function DX_Read works optionally with an internal memory buffer.
The import procedure is much faster when this buffer is used (at least by a factor of 2.)
If the buffer is used, the maximum object size is 16k. The object size is the number of charac-
ters that are needed to describe a QuarkXPress box (including its text) meaning all characters
between ¶ and ¶.
If the buffer is not used, the maximum object size is 32k.
Turning the buffer on and off
The buffer is by default switched on by the function DX_Init(-1), called up in your startup pro-
cedure.
To switch the buffer off you write after the line DX_Init(-1):
DX_Buffer:=False
`Max. object size: 32K
The buffer can then be switched on in another place in your programme by
DX_Buffer:=True
`Max. object size: 16K.
The variable DX_Buffer is checked by DX_Read and used in the next import procedure.
DX_FilePos for DX_Read
Shows the current position in the open file. Every read procedure by DX_Read moves the posi-
tion. DX_FilePos can be used, for example, to show the progress of the read procedure:
The file length is read in a variable before the read procedure.
àFileSize:=Get document size (path)
In the actual read loop the progress can then be shown as percentages, i.e.:
$i:=0
While (DX_Read (3))
$i:=$i+1
If ($i%10=0)
MESSAGE("Objects: "+String($i)+(" "*10)+String(DX_FilePos/àFileSize*100; "## %"))
end if
End while