-
Subtracts an integer from the current parameter in the active input buffer.
Syntax
-n
Syntax Elements
n is the integer to be subtracted.
Operation
The – command subtracts the integer specified by n from the current parameter in the active input buffer.
If the number of characters within a parameter decreases after a - command, the result is loaded with leading zeros to maintain the same number of characters as the previous value.
Parameters within the input buffer can be preceded by a minus sign.
If the buffer pointer is at the end of the buffer, a new parameter is created by the - command.
If the referenced parameter is nonnumeric, a zero is used.
Example 1
Command |
PIB Before |
PIB After |
---|---|---|
|
|
|
Example 2
001 PQN
002 OENTER A NUMBER+
003 S6
004 IBP
005 +3
006 T %6
007 -1
008 T %6
009 RTN
This example receives input from the terminal and places it in the 6th parameter of the primary input buffer. It adds 3 to the value stored in the 6th attribute and displays the result. It then subtracts 1 from the result and displays the new value.