Setfileposition – AMT Datasouth PAL User Manual
Page 174
setfileposition
168
setfileposition
Description
Relocates a file's read/write pointer.
Usage
OpenFile PositionInt
setfileposition
OpenFile
File. File object for open file to relocate read/write pointer.
PositionInt
Integer. New offset for file's read/write pointer from start of file. A value of zero
indicates the first byte of the file.
Comments
This operator allows the programmer to randomly read and write various locations of a direct
access file. This operator has no affect on sequential files. Sequential files include all of the
standard PAL files.
Hints
The following example uses setfileposition to write the string "olleH" to the file MyFile.
MyFile 4 setfileposition MyFile (H) writestring
MyFile 3 setfileposition MyFile (e) writestring
MyFile 2 setfileposition MyFile (l) writestring
MyFile 1 setfileposition MyFile (l) writestring
MyFile 0 setfileposition MyFile (0) writestring