Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved


Chapter 3 Tools : ABS

ABS
Returns the absolute value of a number. (F)
Invocation
number = ABS(value)
 
Example
The following rule determines the absolute value of -1 and prints it to the workbench or screen:

 
RULE EDITOR ===> SCROLL: P
ABS_1;
_ LOCAL NUMBER, VALUE;
_ ---------------------------------------------------------------------------
_ ------------------------------------------------------------+--------------
_ VALUE = - 1; | 1
_ NUMBER = ABS(VALUE); | 2
_ CALL ENDMSG('THE ABSOLUTE VALUE OF ' || VALUE || ' IS ' || | 3
_ NUMBER ||'.'); |
_ ---------------------------------------------------------------------------

 
The following end message appears after the rule is executed:
THE ABSOLUTE VALUE OF -1 IS 1.

Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved