LIST and LISTEND


 

The LIST and LISTEND data definitions allow referencing variables defined between the instructions by a single label in instructions supporting variable lists. The instruction uses the following formats:

 

(1)

[label]

LIST

 

(Various Data Definition Instructions)

 

 

LISTEND

 

(2)

[label]

LIST

^

(3)

[label]

LIST

^,{variable}

 

Where:

label

Optional. A Data Definition Label.

^

Optional. Denotes the item as being a POINTER.

variable

Required. The name of a previously defined variable of the same type.

Flags Affected: NONE

Note the following:

  1. LIST/LISTEND work with any background or I/O instruction (including screen and file I/O) that supports variable lists.

  2. The LIST Data Definition Label associated is all that needs referencing within the instruction. Each variable within the list is processed individually as if it were listed within the instruction.

  3. The only variable types that are allowed in a LIST/LISTEND structure are DIM, INIT, FORM, and INTEGER. EQUATE, and VARLIST may be in the list and are ignored. Another LIST/LISTEND or a RECORD/RECORDEND structure may be in the structure.

  4. LIST/LISTEND structures may be nested up to ten levels deep.

  5. The ^ denotes a Pointer Variable.

  6. A pointer of this type can be with any instruction that supports variable lists.

Example:

 

WRNAM

LIST

 

LAST

DIM

20

FIRST

DIM

15

MIDDLE

DIM

15

  

LISTEND

 

.

 

 

FILE

FILE

 

SEQ

FORM

"-1"

.

 

 

  

WRITE

FILE,SEQ;WRNAM

  

COUNT

BYTES,WRNAM

  

DISPLAY

*P01:24,WRNAM:

  

  

" consists of ",BYTES," bytes of non-blank data"

 

 

See Also: RECORD, VARLIST, Data Definitions

 



PL/B Language Reference LABEL RECORD and RECORDEND