The Min procedure is used to compare a list of two or more numeric values and return the lowest value.
lower-numeric-value Min( nCompValue1 30P 9 Const : nCompValue2 30P 9 Const : nCompValue3 30P 9 Const : ... repeat for additional compare values up to 16 times... ) |
|
See also: InList |
The procedure compares each parameter and returns the lowest value on the list of specified values.
The procedure compares each parameter and returns the lowest value on the list of specified values.
.....CSRn01..............OpCode(ex)Extended-factor2+++++++++++++++++++++++
C eval i = min(7 : 8.5 : nLimit/2 : nCount )
In this example, the lowest value specified on the parameter list for the MIN() procedure is returned. If either nCount or nLimit/2 are less than 7, their value will be returned, otherwise the number 7 (the first parameter) is returned.
Typically, all values specified will be of the same data type and lengths
The Max procedure is used to compare a list of two or more numeric values and return the largest value.
highest-numeric-value Max( nCompValue1 30P 9 Const : nCompValue2 30P 9 Const : nCompValue3 30P 9 Const : ... repeat for additional compare values up to 16 times... ) |
|
See also: InList |
The procedure compares each parameter and returns the value on the list with the highest numeric value.
.....CSRn01..............OpCode(ex)Extended-factor2++++++++++++++++++++++++++
C eval i = max(7 : 8.5 : nLimit/2 : nCount )
C eval BestMonth = max(Jan:Feb:Mar:Apr:May:Jun:
C eval Jul:Aug:Sep:Oct:Nov:Dec)
In this example, the highest value specified on the parameter list for the MAX() procedure is returned. If either nCount or nLimit/2 are greater than 8.5, their value will be returned, otherwise the number 8.5 (the second parameter) is returned. Typically, all values specified will be of the same data type and lengths.
The second line finds the highest monthly sales figure and stores it in the BestMonth field.