Noobster24 Posted October 9, 2006 Share Posted October 9, 2006 (edited) Hi, i got this array: $Links1 or $Links2 or $Links3 and i want to find the max index number. Like this: $Links1[0] = 'hi' $Links1[1] = 'hadf' $Links1[2] = 'adsfdsfhi' $Links1[3] = 'dfljaleuhi' So i want to get the number 3... I checked the helpfile for _ArrayMaxIndex and _ArrayMax but they doesn't give me the result i want, i'm probably coding it wrong ... Like this example: #include <Array.au3> Dim $Links1[4] $Links1[0] = 'hi' $Links1[1] = 'hadf' $Links1[2] = 'adsfdsfhi' $Links1[3] = 'dfljaleuhi' MsgBox(0,'Max Index String value',_ArrayMaxIndex( $Links1, 0, 0)) MsgBox(0,'Max Index String value',_ArrayMaxIndex( $Links1, 0, 1)) MsgBox(0,'Max Index Numeric value',_ArrayMaxIndex( $Links1, 1, 0)) MsgBox(0,'Max Index Numeric value',_ArrayMaxIndex( $Links1, 1, 1)) MsgBox(0,'Max String value',_ArrayMax( $Links1, 0, 1)) MsgBox(0,'Max Numeric value',_ArrayMax( $Links1, 1, 1)) MsgBox(0,'Max Numeric value',_ArrayMax( $Links1, 1, 0)) MsgBox(0,'Max Numeric value',_ArrayMax( $Links1, 0,0)) It doesn't give me the 3 What am i doing wrong? Edited October 9, 2006 by Noobster24 Programs so far:Teh Serializer - Search for licenses for Nero - Windows - Office - Alcohol etc. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 9, 2006 Moderators Share Posted October 9, 2006 UBound() doesn't work for you?Dim $Links1[4] $Links1[0] = 'hi' $Links1[1] = 'hadf' $Links1[2] = 'adsfdsfhi' $Links1[3] = 'dfljaleuhi' MsgBox(64, 'Info', 'The total elements are: ' & UBound($Links1) - 1) Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Noobster24 Posted October 9, 2006 Author Share Posted October 9, 2006 UBound() doesn't work for you?Dim $Links1[4] $Links1[0] = 'hi' $Links1[1] = 'hadf' $Links1[2] = 'adsfdsfhi' $Links1[3] = 'dfljaleuhi' MsgBox(64, 'Info', 'The total elements are: ' & UBound($Links1) - 1) Damn, you're a genious right? Programs so far:Teh Serializer - Search for licenses for Nero - Windows - Office - Alcohol etc. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 9, 2006 Moderators Share Posted October 9, 2006 (edited) Damn, you're a genious right? Yeah, my genious plaque is right next to my jerk of the year award Edited October 9, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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