Subtract

Syntax

SUBTRACT expression variable [ GIVING variable ] [ ROUNDED ] [ GS status ]

Parameters

Subtract can be abbreviated as SB.

Description

The Subtract logic command subtracts the value of a numeric expression from the value of a number-primitive variable and stores the result in that variable, or optionally subtracts the result of the first expression from the result of the second expression and stores the result in a specified result variable.

The behavior of the Subtract logic command can be replicated use of the '-' arithmetic operator. Use of arithmetic operators, where possible, rather than arithmetic logic commands, is the LDL+ preferred format.

Failure behavior

The Glb.Status built-in segment attribute is not set. Use the GS command option to test for arithmetic overflow.

Example

Work := Debt.CredLimit
Subtract Total Work