MonsieurOUXX Posted April 17, 2009 Share Posted April 17, 2009 (edited) Hi, I'd like to perform something like this : Func BuildObject(ByRef $array) $array[0] = "0" $array[1] = "1" EndFunc Func _Main() Local $array BuildObject($array) _ArrayDisplay($array) EndFunc In other words, I'd like an object to be declared at a higher level in the code, and be "built" by a function that would act as a factory. The dimensions of the object are not know at declaration time. They are known only by the factory. The code above is not correct in the autoIT syntax. Can you tell me how to make it correct? Edited April 17, 2009 by MonsieurOUXX Link to comment Share on other sites More sharing options...
MonsieurOUXX Posted April 17, 2009 Author Share Posted April 17, 2009 OK, my mistake, the code below works : Func BuildObject1D(ByRef $array) Local $_array[2] = ["0", "1"] $array = $_array EndFunc Func BuildObject2D(ByRef $array) Local $_array[2][2] = [["0", "_0"], ["1","_1"]] $array = $_array EndFunc Func _Main2() Local $array BuildObject1D($array) BuildObject2D($array) _ArrayDisplay($array) EndFunc I'll come back with a more accurate question Link to comment Share on other sites More sharing options...
MonsieurOUXX Posted April 17, 2009 Author Share Posted April 17, 2009 OK, forget about my posts, I made a mistake with an index out of bounds. Shame on me. 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