MAXIMUM()

Top  Previous  Next

 

The MAXIMUM() function returns the greatest value in a dynamic array.

 

 

Format

 

MAXIMUM(dyn.array)

 

where

 

dyn.arrayis the dynamic array to be scanned.

 

 

The MAXIMUM() function returns the greatest numeric value in a dynamic array that uses any of the five mark characters as separators. Non-numeric and null elements of dyn.array are ignored. If the entire dynamic array is null, a null string is returned.

 

The SYSTEM() function with key value 1088 (SYS$MAXMINPOS) can be used to retrieve the dynamic array position of the maximum element as a string formed from the field, value and subvalue numbers separated by value marks. If dyn.array is a null string, this function will return a null string. If there are multiple elements that have the maximum value, the position of the first one is returned. The positional information is undefined if dyn.array contains text marks or item marks.

 

 

Example

 

S = '61':@VM:'42':@FM:'71':@VM:'57'

CRT MAXIMUM(S)

POS = SYSTEM(1088)

 

This program fragment searches S for the largest numeric value and displays the result (71). The POS variable will be set to the position at which this value was found as "2VM1VM1".

 

 

See also:

MINIMUM()