tbaror Posted July 9, 2008 Share Posted July 9, 2008 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?. Thanks Link to comment Share on other sites More sharing options...
monoceres Posted July 9, 2008 Share Posted July 9, 2008 _ArrayMin is very easy to rewrite: Dim $array[5]=[10,-1,8,2,6] $lowest=_ArrayMin_Mod($array,0) 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 $iLowest=$aArray[$i] EndIf Next Return $iLowest EndFunc muttley Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
tbaror Posted July 9, 2008 Author Share Posted July 9, 2008 thanks muttley Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now