The statement allows for reading from a file opened for sequential access. It takes the general form:
READSEQ Variable FROM filevar THEN | ELSE statements
- Variable specifies the variable to contain next record from sequential file.
- filevar specifies the file descriptor of the file opened for sequential access.
- Statements Conditional jBASE BASIC statements
Each 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.
The default buffer size for a READSEQ is 1024 bytes. This can be changed using the IOCTL function with the JIOCTL_COMMAND_SEQ_CHANGE_RECORDSIZE Sequential File Extensions.
An example of use would be as:
OPENSEQ ".", "report.txt" TO FILE_VAR ELSE ABORT 201, "report file" READSEQ VAR_LINE FROM FILE_VAR THEN CRT VAR_LINE
to open a "report file" and read the first line from it.
Go back to jBASE BASIC.