Hooch Posted July 28, 2004 Posted July 28, 2004 Hey there, I have made a string list delimited by "|" and each of those list items contains a sub list delimited by a "," like so: $biglist = "circle1, circle2, circle3|box1,box2,box3" $listArray = stringsplit($biglist, "|") $item1 = stringsplit($listArray[1], ",") soooo... $item1 would = "circle1" All fine and good. Now what I want to do is do that for every item in the biglist. My problem is I can't find out how to do a loop over the whole array, I don't see an arrayLen() type function... am I just missing it? Alternatively, am I going about this the long hard way and missing an easier method?
thijzzz Posted July 28, 2004 Posted July 28, 2004 i am really new at v3 but $array[0] is the length of the array if i am not mistaken.
Hooch Posted July 28, 2004 Author Posted July 28, 2004 Ah crap your right, soon as I read your reply I remembered this part of the help file: Returns an array, the first element ($array[0]) contains the number of strings returned, the remaining elements ($array[1], $array[2], etc.) contain the delimited strings.
Valik Posted July 28, 2004 Posted July 28, 2004 UBound() is the function you were looking for which returns the length of an array.
scriptkitty Posted July 29, 2004 Posted July 29, 2004 You can also use the first item in the array of a stringsplit [0] Ex: $biglist = "circle1, circle2, circle3|box1,box2,box3" $listArray = stringsplit($biglist, "|") for $i= 1 to $listArray[0] $item1 = stringsplit($listArray[$i], ",") for $b= 1 to $item1[0] msgbox(1,$listArray[$i],$item1[$b]) next next AutoIt3, the MACGYVER Pocket Knife for computers.
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