IOLIST Verb

Syntax

IOLIST item{,item...}

Description

The IOLIST verb is used to create an IOLIST that contains a set of variables that can be referenced in input or output statements. For example, to READ the same file in several places in a program. Using one IOLIST for all of the READs reduces the chance of bugs and saves program space. I/O statements can reference the IOLIST using the IOL= option.

Values for item Parameter

string {: stringmask}

Evaluates and outputs the string expression. If stringmask is used, the output is applied to the mask. See the STR() function for additional string masking information.

num {: string}

Evaluates any numeric expression and outputs the results according to the rules for numeric output. See Numeric Output for additional information. num {: string} uses the optional colon and string as an output format mask. If no mask is given, PRINT outputs a space followed by the number. WRITE does not output a space.

array[ALL]

Outputs an entire numeric or string array. If array X is dimensioned to five elements (0 to 4), then X[ALL] is identical to X[0], X[1], X[2], X[3], and X[4]. Each output element is a field.

'mnemonic'

A mnemonic is a string of ASCII characters enclosed in tick marks (') and can be 2 to 16 characters long. Mnemonics perform special functions on some devices. For example, the mnemonic 'CS' clears the screen on a video terminal. Mnemonics allow device-independent programs to be written.

@(col {,row})

On a terminal, the cursor moves to the location on the screen specified by col and row. col and row must be integers in the range of 0 to 255. If only col is given, PRO/5 assumes the current row on the screen. The top left corner of the screen is @(0,0). On a printer, col produces movement within the current print line, while row is ignored by printers.

*

Null field. Though the asterisk is significant in an input list, it is defined for an output list only because an IOLIST statement may be used for both input and output.

IOL=lineref

Refers to the IOLIST statement at lineref for more list items. PRO/5 behaves as if the items in the IOLIST were in place of the IOL= option. Several IOL= items can appear in an list. An IOLIST can also invoke other IOLISTs with the IOL= option until memory runs out. If there is no IOLIST at lineref, PRO/5 issues an error.

When an input statement invokes an IOLIST, only simple variables and array[ALL] items are actually input. Everything else, such as constants or variables that are part of expressions, is output. A more complete explanation may be found in the discussion of the inputlist parameter for the READ verb.

IOLIST can be used in run mode only. Although it cannot be used in a compound statement, it may have a line label. During normal program execution, PRO/5 skips IOLIST statements.

Examples

1000 IOLIST A$,B$,C[ALL]
0060 IOLIST 'CS',@(40-INT(LEN(Z0$)/2),0),Z0$, @(60,1),"DATE:",DAY,@(0,2),B1$

See Also

Verbs - Alphabetical Listing