Jump to content

Recommended Posts

Posted

Hello again,

i have an array like this 

aArray = -7, -4, 0, 1, 6, 8

I want to find the lowest number except the negative ones an zero (should be 1)

Any good idea?

Thank you so much

Posted (edited)

Look at _ArrayMin()

EDIT: Sorry I overlooked needed condition for zero/negative numbers, so as TheDCoder said ...

 

here example from helpfile:

#include <Array.au3>

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

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

 

Edited by Zedna
Posted

Thank you so much! It works for me with this code:

local $FindGreaterO =_ArrayExtract($new,-1,-1,4,4)
For $i = 0 To UBound($FindGreaterO)-1 Step 1
    $FindGreaterO[$i] = StringReplace($FindGreaterO[$i],",",".")
    $FindGreaterO[$i] = Number($FindGreaterO[$i])
Next

For $i = UBound($FindGreaterO) -1 to 0 step -1
    If $FindGreaterO[$i] <= 0.01 Then _ArrayDelete($FindGreaterO, $i)
Next
$FindNull=StringReplace(_ArrayMin($FindGreaterO),".",",")
ConsoleWrite($FindGreaterO)

 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...