Jump to content
Sign in to follow this  
cili1

Arrays - Give array with lowest value.

Recommended Posts

cili1

I'm using a multi dimensional array in one of my script.

One of the elements in the array contains a value.

What I can't figure out is how to parse through the array and output the index that got the lowest value.

My arrays look something like this.

$cache[0][0] = 3
$cache[1][0] = 1
$cache[2][0] = 2

In this case "$cache[1][0]" would be the one with the lowest value.

Share this post


Link to post
Share on other sites
picea892

You're looking for _arraymin

#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))

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.