Original Author Paul Laughton, 2011
Page 110
De Re BASIC!
When you are done reading a file, the Text.close command should be used to close the file.
Text.writeln <file_table_nexp>, <parms same as Print>
The parameters that follow the file table pointer are parsed and processed exactly the same as the Print
command parameters. This command is essentially a Print to a file.
If a parameter line ends with a semicolon, the data is not written to the file. It is stored in a temporary
buffer until the next Text.writeln command that does not end in a semicolon. There is only one
temporary buffer no matter how many files you have open. If you want to build partial print lines for
more than one file at a time, do not use Text.writeln commands ending with semicolons. Instead use
string variables to store the temporary results.
After the last line has been written to the file, the Text.close command should be used to close the file.
Text.writeln with no parameters writes a newline.
Text.eof <file_table_nexp>, <lvar>
Report an opened file's end-of-file status. If the file is at EOF, the <lvar> is set true (non-zero). If the file
or directory is not at EOF, the <lvar> is set false (zero).
A file opened for write or append is always at EOF. A file opened for read is not at EOF until all of the
data has been read and then one more read is attempted. That read will have returned the string "EOF".
Text.position.set may also position the file at EOF.
Text.position.get <file_table_nexp>, <position_nvar>
Get the position of the next line to be read or written to the file. The position of the first line in the file is
1. The position is incremented by one for each line read or written. The position information can be
used for setting up random file data access.
Note: If a file is opened for append, the position returned will be relative to the end of the file. The
position returned for the first line to be written after a file is opened for append will be 1. You will have
to add these new positions to the known position of the end of the file when building your random
access table.
Text.position.set <file_table_nexp>, <position_nexp>
Sets the position of the next line to read. A position value of 1 will read the first line in the file.
Text.position.set can only be used for files open for text reading.
If the position value is greater than the number of lines in the file, the file will be positioned at the end
of file. The position returned for Text.position.get at the EOF will be number of lines plus one in the file.