Operands


ANSI

OPERANDs are the PL/B instruction parameters - the parameters required by OPERATION or the data field definition. The general format of operands is as follows:

 

 

FIRST SEPARATOR SECOND

 

FIRST is the first OPERAND that may be required by OPERATION. SEPARATOR is required if a second OPERAND is used and may be a comma (,) or a valid PL/B preposition.

 

SECOND is any additional OPERAND (or OPERANDS) required by OPERATION. If a comma SEPARATOR is used, it cannot be preceded by a space. Otherwise, a valid preposition (BY, TO, OF, FROM, USING, WITH, IN or INTO as appropriate to OPERATION) must be used with at least one preceding and trailing space.

 

The following are examples of valid PL/B OPERAND syntax:

 

 

FIRST,SECOND

 

 

FIRST TO SECOND

(TO is a valid SEPARATOR)

 

FIRST TO SECOND

(multiple spaces may be used)

 

PRIM,SEC1,SEC2,SEC3

(multiple SECONDARY OPERANDS)

 

The following are examples of invalid PL/B OPERAND syntax:

 

 

FIRST SECOND

(missing SEPARATOR)

 

FIRST ,SECOND

(space preceding comma)

 

FIRST INSIDE SECOND

(INSIDE is not a valid SEPARATOR)

 

OPERATIONs that may have a variable number of operands require a comma as the SEPARATOR. If the list exceeds a single line, a colon (:) is used in place of a valid SEPARATOR to continue the list onto the next line. A double colon (::) continues a literal on another line. A single colon means to terminate the literal but continue the statement. A double colon also continues a statement on another line at a point where a single colon is normally used as a separator between two fields.

 

The maximum source statement length is 4096.

 

A valid SEPARATOR example within a DISPLAY OPERATION:

 

 

DISPLAY

*N,"This is the 1st line of data ",DATA,DATA:

 

 

*N,"This is the 2nd line of data ",DATA,DATA:

 

 

*N,"This is the 3rd line of data ",DATA,DATA

 

The same SEPARATOR example without using line continuation:

 

 

DISPLAY

*N,"This is the 1st line of data ",DATA,DATA;

 

DISPLAY

*N,"This is the 2nd line of data ",DATA,DATA;

 

DISPLAY

*N,"This is the 3rd line of data ",DATA,DATA

 

Example of a literal continued on multiple lines using double colons:

 

 

MOVE

"This is an example of a fairly long "::

 

 

"literal that is continued on 3 "::

 

 

"lines",DESCRIPTION

 

Example of a colon separated list control continued on multiple lines:

 

 

DISPLAY

*SETSWALL=TOP::

 

 

  BOTTOM::

 

 

  LEFT::

 

 

  RIGHT:

 

 

  *ES;

 

An alternate method of line continuation places a colon in the first column of a source line. The remainder of the line is then appended to the previous line.

 

REPLY

DIM

1

 

KEYIN

*HD,"This is a single statement

: using the line continuation character. ",REPLY

 

 

See Also: Instruction Syntax

 



PL/B Language Reference Labels Comments