Syntax
Public Function ArrayMaximum(ary As Variant, start As Integer, Optional Count As Integer = -1) As Integer
Description
This function is used to get the maximum number in a numeric array from a specific given start position.
Parameters
Key | Description |
ary | Array to get the max value, value of type Variant. |
start | Index to start checking max number, a value of type Integer. |
Count | Number of search elements, by default searches all array,value of type Integer. |
Return value
Returns the maximum value in the selected array as Integer. In case of failure, returns -1.
Sample
Public Sub main () Dim Arr CopyHigh 0, 10, 20, Arr Dim Result Result = ArrayMaximum (Arr,1,-1) AlertMessage (Result) Returns the maximum number at Arr End sub
See Also