Subtracts one numeric expression from another numeric expression.
Syntax
expression - expression
expression
An expression with a numeric value.
Example
The r-subt.p procedure determines the amount of inventory available by subtracting the amount allocated from the total on hand.
r-subt.p
DEFINE VARIABLE free-stock NO-UNDO LIKE on-hand LABEL "Free Stock".
FOR EACH Item NO-LOCK:
free-stock = Item.OnHand - Item.Allocated. DISPLAY Item.ItemNum Item.ItemName Item.OnHand Item.Allocated free-stock.
END.
Note
Subtracting one decimal expression from another produces a DECIMAL value. Subtracting one INTEGER expression from another produces an INTEGER. Subtracting an integer expression (INTEGER or INT64) from a decimal expression (or subtracting a decimal expression from an integer expression) produces a DECIMAL value. Subtracting a mix of INTEGER and INT64 expressions produces an INT64 value.