PreviousNextIndex

MODULO operator

Determines the remainder after division.

Syntax

expression MODULO base 

expression
base
Example

This procedure determines the number of trucks required to ship a given quantity of material, and how much material is left over from a less than full truck load:

r-modulo.p
REPEAT: 
  SET qty-avail AS INTEGER LABEL "Qty. Avail.". 
  SET std-cap AS INTEGER LABEL "Std. Truck Capacity". 
  DISPLAY TRUNCATE(qty-avail / std-cap,0) FORMAT ">,>>9" LABEL "# Full Loads" 
    qty-avail MODULO std-cap LABEL "Qty. Left". 
END. 

Note

The expression must be greater than 0 for MODULO to return a correct value.

See also

INTEGER function, ROUND function, TRUNCATE function


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex