tdpaxton Posted September 29, 2005 Posted September 29, 2005 I'm am trying to add values to a multi-dimensional array using the _ArrayAdd function. I can't figure out the syntax for it though. Here is what I have, but it doesn't work. $temparray = StringSplit($fileline, Chr(9)) _ArrayAdd($someArray, $temparray[1], $temparray[2]) Thanks!
is8591 Posted September 29, 2005 Posted September 29, 2005 I'm am trying to add values to a multi-dimensional array using the _ArrayAdd function. I can't figure out the syntax for it though. Here is what I have, but it doesn't work.$temparray = StringSplit($fileline, Chr(9))_ArrayAdd($someArray, $temparray[1], $temparray[2])Thanks!_ArrayAdd works only on 1 dimensional arrayI would ReDim array by 1 and loop through all indexes
Josbe Posted September 29, 2005 Posted September 29, 2005 I'm am trying to add values to a multi-dimensional array using the _ArrayAdd function. I can't figure out the syntax for it though. Here is what I have, but it doesn't work.$temparray = StringSplit($fileline, Chr(9))_ArrayAdd($someArray, $temparray[1], $temparray[2])Thanks! I think that _ArrayAdd like _ArrayDisplay, was designed only for unidimensional arrays. AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta
Valuater Posted September 29, 2005 Posted September 29, 2005 StringSplit() returns a single dimensional array here is a good example of this conmbined with _ArrayAdd() #include <Array.au3> $days = StringSplit("Sun,Mon,Tue,Wed,Thu,Fri", ",") ;$days[1] contains "Sun" ... $days[7] contains "Sat" for $x = 1 to $days[0] MsgBox(0,"test", " The Day is " & $days[$x] & " ") Next _ArrayAdd($days, "Sat") for $x = 1 to $days[0] +1 MsgBox(0,"test", " The Day is " & $days[$x] & " ") Next _ArrayAdd adds to the END of the array 8)
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