![]() ![]() |
|
Sequential File AccessOPENSEQOpen file for sequential writing and or reading. OPENSEQ Path{,File} {READONLY} TO FileVar { LOCKED statements } THEN | ELSE statements Where:
NOTESIf the file does not exist or cannot be opened then the ELSE clause is executed. However if JBCEMULATE is set for Sequoia (use value "seq") emulation then OPENSEQ will create the file if it does not exist. This behavior can also be achieved by specifying "openseq_creates = true" in Config_EMULATE for the emulation being used. Once open a lock is taken on the file. If the lock cannot be taken then the LOCKED clause is executed if it exists otherwise the ELSE clause is executed. If READONLY is specified then the process takes a read lock on the file otherwise a write lock is taken. The specified file can be a regular, pipe or special device file. Locks are only taken on regular file types. Once open the file pointer is set to the first line of sequential data.
CLOSESEQClose file previously opened for sequential access. CLOSESEQ FileVar Where:
READSEQRead from file opened for sequential access. READSEQ Variable FROM FileVar THEN | ELSE statements Where:
NOTESEach READSEQ reads a line of data from the sequentially opened file. After each READSEQ the file pointer moves forward to the next line of data. The variable contains the line of data less the new line character from the sequential file.
WRITESEQWrite data to file opened for sequential access. WRITESEQ Expression {APPEND} TO FileVar THEN | ELSE statements or WRITESEQF Expression {APPEND} TO FileVar THEN | ELSE statements Where:
NOTESEach WRITESEQ writes the data on a line of the sequentially opened file. Each data is suffixed with a new line character. After each WRITESEQ the file pointer moves forward to the end of line. The WRITESEQF statement forces each data line to be flushed to the file when it is written. The APPEND option forces each WRITESEQ to advance to the end of the file before writing the next data line.
WEOFSEQWrite end of file on file opened for sequential access. WEOFSEQ FileVar { THEN | ELSE Statements} Where:
NOTESThe WEOFSEQ forces the file to be truncated at the current file pointer. |