9.206 STM_FILE_READ
This Built-In function reads data from the specified stream file. The stream file was previously opened by a STM_FILE_OPEN.
If the stream file was opened with a LineTerminator option, then data up to the specified line terminator will be return by a STM_FILE_READ action.
If the stream file was opened with a LineTerminator=NONE option, then as much data as will fit in the provided Returned Data Blocks will be return by the STM_FILE_READ action.
Related Built-In Functions: STM_FILE_OPEN, STM_FILE_CLOSE, STM_FILE_WRITE, STM_FILE_WRITE_CTL. Refer to 9.205 STM_FILE_OPEN for the Line Terminators used.
Arguments
No | Type | Req/ Opt | Description | Min Len | Max Len | Min Dec | Max Dec |
|---|---|---|---|---|---|---|---|
1 | N | Req | File number (file handle) of the file from which data is to be read. This number was allocated to the stream file by the STM_FILE_OPEN. | 1 | 3 | 0 | 0 |
Return Values
No | Type | Req/ Opt | Description | Min Len | Max Len | Min Dec | Max Dec |
|---|---|---|---|---|---|---|---|
1 | A | Req | Returned data block 1 Data will be returned up to the length of this data block | 1 | Unlimited | ||
2 | A | Opt | Return Code OK = Data has been read and returned. OV = Data overflow. EF = End of file encountered. ER = Error occurred. | 2 | 2 | ||
3 | A | Opt | Returned data block 2 | 1 | Unlimited | ||
4 | A | Opt | Returned data block 3 | 1 | Unlimited | ||
5 | A | Opt | Returned data block 4 | 1 | Unlimited | ||
6 | A | Opt | Returned data block 5 | 1 | Unlimited | ||
7 | A | Opt | Returned data block 6 | 1 | Unlimited | ||
8 | A | Opt | Returned data block 7 | 1 | Unlimited | ||
9 | A | Opt | Returned data block 8 | 1 | Unlimited | ||
10 | A | Opt | Returned data block 9 | 1 | Unlimited | ||
11 | A | Opt | Returned data block 10 | 1 | Unlimited |
Example
Refer to 9.205 STM_FILE_OPEN.