Progress
Language Reference


MAXIMUM Function

Interfaces
OS
SpeedScript
All
All
Yes

Compares two or more values and returns the largest value.

SYNTAX

MAXIMUM ( expression , expression [ , expression ] ... ) 

expression

A constant, field name, variable name, or expression. If there is a mixture of decimal and integer data types, decimal type is returned.

EXAMPLE

In this procedure, if the credit-limit value is under 20,000, the procedure adds 10,000 to that value. Otherwise, the procedure sets credit-limit to 30,000. The MAXIMUM function determines the greater of the original credit-limit value and the new cred-lim2 value.

r-maxmum.p
DEFINE VARIABLE cred-lim2 AS DECIMAL
    FORMAT ">>,>>9.99".FOR EACH customer:
    IF credit-limit < 20000 THEN cred-lim2 = credit-limit + 10000.
    ELSE cred-lim2 = 30000.
    DISPLAY credit-limit cred-lim2
      MAXIMUM(cred-lim2, credit-limit) 
      LABEL "Maximum of these two values".
END. 

NOTE

When comparing character values, if at least one of the character fields is defined as case sensitive, then MAXIMUM treats all of the values as case sensitive for the sake of the comparisons. If none of the values is case sensitive, MAXIMUM treats lowercase letters as if they were uppercase letters.

SEE ALSO

MINIMUM Function


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095