Max + Min

Calculate maximum of array of numbers
or Minimum of array of numbers
Also, the Min_No0s will get the min ignoring zeros in the array
Edit 2024-06-05: Removing Min_No0s since it has an issue and we do not have replacement now.

CodeFunctionName
What is this?

Public

Tested

Original Work
Function Max(arrNumbers)
    Dim Result
    Result                    = arrNumbers(0)
    for each i in arrNumbers
        If i > Result then
            Result            = i
        End if
    Next
    Max                        = Result
End function
' Returns the numerically lowest value from a given array.
Function Min(arrNumbers)
    Dim Result
    Result                    = arrNumbers(0)
    for each i in arrNumbers
        if i < Result then
            Result            = i
        end if
    next
    Min                        = Result
End function

arrNumbers

Views 1,344

Downloads 444

CodeID
DB ID

ANmarAmdeen
642
Attachments
Revisions

v2.0

Wednesday
June
5
2024