Jump to content

Recommended Posts

Posted

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.

Posted

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

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...