Function Reference


_ArrayMin

Returns the lowest value held in a 1D or 2D array

#include <Array.au3>
_ArrayMin ( Const ByRef $aArray [, $iCompNumeric = 0 [, $iStart = -1 [, $iEnd = -1 [, $iSubItem = 0]]]] )

Parameters

$aArray Array to search
$iCompNumeric [optional] Comparison method:
    0 - compare alphanumerically
    1 - compare numerically
$iStart [optional] Index of array to start search
$iEnd [optional] Index of array to end search
$iSubItem [optional] Column of array to search

Return Value

Success: the minimum value in the array.
Failure: sets the @error flag to non-zero (see _ArrayMinIndex() description for @error).

Related

_ArrayMax, _ArrayMaxIndex, _ArrayMinIndex, _ArrayUnique

Example

#include <Array.au3>
#include <MsgBoxConstants.au3>

Local $aArray = StringSplit("4,2,06,8,12,5", ",")

MsgBox($MB_SYSTEMMODAL, 'Min String value', _ArrayMin($aArray, 0, 1))
MsgBox($MB_SYSTEMMODAL, 'Min Numeric value', _ArrayMin($aArray, 1, 1))

Local $aArray[4][4]
For $i = 0 To 3
        For $j = 0 To 3
                $aArray[$i][$j] = Random(0, 99, 1)
        Next
Next
_ArrayDisplay($aArray, "2D Array")
MsgBox($MB_SYSTEMMODAL, 'Min Numeric value in column 2', _ArrayMin($aArray, 1, 0, -1, 2))