1224 Posted November 28, 2010 Posted November 28, 2010 A script like this For $i = 0 To 4 Step +1 $a[$i][0] = 47 $a[$i][1] = 3 $a[$i][2] = 99 Next I want to do something like below: While $a[$loop] has data MsgBox(0, "", $a[$loop][0] & " - " & $a[$loop][1] & " - " & $a[$loop][2]) $loop += 1 WEnd i.e. The looping will be : MsgBox(0, "", $a[$loop][0] & " - " & $a[0][1] & " - " & $a[0][2]) MsgBox(0, "", $a[$loop][1] & " - " & $a[1][1] & " - " & $a[1][2]) MsgBox(0, "", $a[$loop][2] & " - " & $a[2][1] & " - " & $a[2][2]) MsgBox(0, "", $a[$loop][3] & " - " & $a[3][1] & " - " & $a[3][2]) MsgBox(0, "", $a[$loop][4] & " - " & $a[4][1] & " - " & $a[4][2]) But assume that I don't know the max index of $i How can I do?
Realm Posted November 28, 2010 Posted November 28, 2010 (edited) Hello 1224,I am not sure I fully understand your question or your dilemma, but taking a guess, you want to find a way to get the maximum index of your array. If that is correct look at the function Ubound().For $i = 0 To Ubound($a)-1 $a[$i][0] = 47 $a[$i][1] = 3 $a[$i][2] = 99 NextRealmEdit: Fixed typos. Edited November 28, 2010 by Realm My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry.
1224 Posted November 28, 2010 Author Posted November 28, 2010 Hello 1224, I am not sure I fully understand your question or your dilemma, but taking a guess, you want to find a way to get the maximum index of your array. If that is correct look at the function Ubound(). For $i = 0 To Ubound($a)-1 $a[$i][0] = 47 $a[$i][1] = 3 $a[$i][2] = 99 Next Realm Edit: Fixed typos. yes Thanks for quick reply
Realm Posted November 28, 2010 Posted November 28, 2010 Thanks for quick replyMy Pleasure, I had the time My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry.
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