READTO command v1.1

Pipelines v2.1

 

Purpose, Operands, Usage, Examples, Related

Home

 

Needs examples

 

Syntax

 
>>──READTO──┬─────────┬──────────────────────────────────────────────────────────────><
            └─varname─┘
 

Purpose

 

Use the READTO command to read the next record from the input stream. If an ooRexx variable is specified, the variable is set to the contents of the record. READTO consumes records; once a record has been read by READTO, it is discarded.

 

Operands

 

varname

is the name of the variable in which READTO is to place the contents of the input record. The variable may index an array or a stem. The name you specify must be a valid name for an ooRexx variable. If you do not specify varname, no variable is set.

 

Usage notes

 

1.

The record that READTO reads is consumed immediately; releasing the calling pipeline/CALLPIPE from its suspended state.

 

2.

Use READTO without specifying varname if you wish only to set a return code indicating whether there is another record in the input stream.

 

3.

When the READTO command determines that there are no more records to read; it sets a return code of 12 (end-of-file), and the variable specified by varname is dropped.

 

Examples

 

None.

 

Related

 

ARRAY, OUTPUT, PEEKTO, VARIABLE

 

History

 

Version

 

Date

Action

Description

Pipelines

1.1

28.12.2021

changed

Application-wide rewrite.

2.1

1.0

04.02.2012

created

First version.

2.0