
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FlexFile Reference Guide - <b>a_max()</b>
[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
A_MAX()
Return the greatest value found in a numeric array
-------------------------------------------------------------------------------
Syntax
A_MAX( <aTarget>, [<idxPos>], [<nCount>] )
Arguments
<aTarget> is the numeric type array to evaluate.
<idxPos> is the position in the target array of the first element
to be evaluated. If not specified, A_MAX() begins its search on
the first element of the array.
<nCount> is the number of elements to evaluate. The default is all
elements starting at <idxPos> until the end of the array.
Returns
A_MAX() returns an index to the element which has the maximum
value found in the specified range.
Description
A_MAX() evaluates every element in the specified range of a
numeric type array and returns an index to the largest element.
Examples
// Declare a two dimensional (I)nteger array
LOCAL rows, cols, x
rows = 10
cols = 20
aInteger = A_DECLARE( "I", rows, cols )
// Fill the second row of the array with increasing
// integer values 1 - 20
FOR x = 1 to 20
A_STORE( aInteger, x, A_( 2, x ) )
NEXT
// Fetch the maximum value in the first half of the
// second row.
? A_MAX( aInteger, A_( 2, 1 ), cols / 2 ) // Result: 10
See Also: A_MIN() A_SCAN()
Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson