9 229 STM_FILE_READ

LANSA Technical

9.229 STM_FILE_READ

Þ Note: Built-In Function Rules.

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.228 STM_FILE_OPEN for the Line Terminators used.

For use with

LANSA for i

YES

Visual LANSA for Windows

YES

Visual LANSA for Linux

YES

 

 

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.
If a Line Terminator was specified on the open, data up to the nominated terminator would have been returned.
If Lineterminator=NONE was specified on the open, data would have been returned in the Data Blocks provided.

OV = Data overflow.
A Line Terminator was specified on the open and as much data as will fit in the Data Blocks has been returned, however, more data exists to reach the nominated terminator for this line. The subsequent STM_FILE_READ will return the further data from this line up to the nominated terminator.

EF = End of file encountered.
A read was attempted but no more data is available. The Returned Data Block/s will be returned blank.

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.228 STM_FILE_OPEN.