ABL Reference

Reverses the sign of a numeric expression. Do not confuse this operator with the subtraction operator that subtracts one expression from another.

- expression |

expression

An expression whose value is numeric.

If you supply a negative value for the variable fx, the r-uneg.p procedure uses the unary negative operator (-) to reverse the sign of fx, producing the absolute value of fx (fabs-x).

r-uneg.p

DEFINE VARIABLE fx AS DECIMAL NO-UNDO LABEL "X". DEFINE VARIABLE fabs-x AS DECIMAL NO-UNDO LABEL "ABS(X)". REPEAT: SET fx. IF fx < 0 THEN fabs-x = -fx. ELSE fabs-x = fx. DISPLAY fabs-x. END. |

© 2017 Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved.

Progress® OpenEdge® Release 11.7