Previous Topic: CommandsNext Topic: Labels


Operands

Operands are used to make a command more specific. An example of a statement with one operand is the DOWN command, which moves the cursor down the screen for the number of lines specified by the operand. For example, the statement that moves the cursor down the screen five lines is:

DOWN 5

The command and operand are separated by at least one space. In a statement with only one operand, the operand is terminated by at least one space.

Many commands have two operands. For example, a statement that adds an integer to an accumulator has two operands. The following ADD statement adds 5 to the value of the accumulator A1:

ADD A1,5

Another example is a statement that compares a variable and a string such as "&USERID" and "USER1":

COMPARE '&USERID','USER1'

Another is a statement that causes the program to branch to another statement if a certain condition code exists. A statement such as the one below may appear after the statement comparing the value of &USERID with the string USER1. The statement says to branch to the statement labeled OKAY if it is true that the value of &USERID is the string USER1:

BRANCH EQ,OKAY

In a statement that contains two operands, the command and first operand are separated by at least one space, and the first and second operands are separated by a comma only. An error message will appear if there is a space before or after the comma.