Jump to content
Sign in to follow this  

_ArrayMin with condition

Recommended Posts


Hello ,

i am using function _ArrayMin for lowest numerically value , but the array i am using this function might include value -1 that i would like to avoid ,my question is there any way to search for lower value but that bigger than -1 for this example?.


Share this post

Link to post
Share on other sites

_ArrayMin is very easy to rewrite:

Dim $array[5]=[10,-1,8,2,6]

MsgBox(0,"Lowest is:",$lowest)

Func _ArrayMin_Mod(ByRef $aArray, $iFloor=0)
    Local $iLowest=""
    For $i=0 To Ubound($aArray)-1
        If $iLowest="" Or ( $aArray[$i]<$iLowest And $aArray[$i]>=$iFloor) Then
    Return $iLowest


Broken link? PM me and I'll send you the file!

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.