Glyph Posted April 17, 2008 Share Posted April 17, 2008 (edited) $max = 101 $array[$max][2] ; 0 = socket, 1 = username for $i = 0 to $max ; loop until u find an open array if not $array[$i][1] then _arrayadd($array[$i][0],"socket") ; Is this the correct way to array add to a multi dimensional array? _arrayadd($array[$i][1],"user1") ; Is this the correct way to array add to a multi dimensional array? $i = $max endif nextoÝ÷ جƥ(·öl(׫x!£hi×]jÖ¢Ø^jºÚË^Ø^íý²j+zØZWbéìÓéá£hué^µè#ozÚâyÛaƧv-ýz-²êÞûaȬ¶©®^¯²¶hÖ®¶seö'&FVÆWFRb33c¶'&²b33c¶Ò²6÷VÆBFVÆWFR&÷FVÆVÖVçG2âFRb33c¶'&ð Edited April 17, 2008 by BackStabbed tolle indicium Link to comment Share on other sites More sharing options...
junkew Posted April 17, 2008 Share Posted April 17, 2008 array.au3 include file only supports single dimension arrays You have to write your own logic to use a multidimensional array. * Adding by using redim * deleting by shifting yourself to the right spot $array[1][2] ; 0 = socket, 1 = username $array[0][0]="socket" $array[0][1]="user1" FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 17, 2008 Share Posted April 17, 2008 The Array.au3 UDF supports 2D arrays for most functions in the 3.2.11.x Beta versions. In the 3.2.10.0 Production version, _ArrayDelete() is 1D only, but it is 2D in the Beta: ; Fails in Prod, Works in Beta #include <Array.au3> Global $avArray[4][2] = [[1, 2], [10, 20], [100, 200], [1000, 2000]] _ArrayDelete($avArray, 2) _ArrayDisplay($avArray, "$avArray") Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
kuhasu Posted April 27, 2008 Share Posted April 27, 2008 The Array.au3 UDF supports 2D arrays for most functions in the 3.2.11.x Beta versions. In the 3.2.10.0 Production version, _ArrayDelete() is 1D only, but it is 2D in the Beta: ; Fails in Prod, Works in Beta #include <Array.au3> Global $avArray[4][2] = [[1, 2], [10, 20], [100, 200], [1000, 2000]] _ArrayDelete($avArray, 2) _ArrayDisplay($avArray, "$avArray") I like u! hope _ArrayToString also can work in multi-demensional arrays.. http://www.autoitscript.com/forum/index.php?showtopic=69916 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