Uten Posted September 24, 2005 Share Posted September 24, 2005 Arrays are such a versatile way of storing and manipulate data. In Autoit you can have a Array of Arrays but there is, as fare as I know, a cavete. You can not assigne a sub array to a variable by reference. Ex: #include <Array.au3> Func GetSubArray(ByRef $rootArr, $arrID, ByRef $subArr) ;Use $arrID to locate the subArr, in this sample 0 dim $index=0 ;This will creata a copy of the array in $rootArr[0]. ;Is it possible to assigne it by reference? $subArr = $rootArr[0] EndFunc dim $rootArr[2] $rootArr[0] = _ArrayCreate("Item1","Item2","Item3") dim $subArr GetSubArray($rootArr, "SomeID", $subArr) $subArr[0] = "Modified1" _ArrayDisplay($subArr, "Retrived sub array") _ArrayDisplay($rootArr[0], "Referenced array") Have I missed how or is it not possible to assigne an array by reference to a new variable? Would it be hard to implement? I'm asking since I feel the code sort of must be inside autoit allready since it suports ByRef in and out of the function. Regards Uten Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling 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