nfwu Posted March 3, 2006 Share Posted March 3, 2006 I have noticed the following happen: (not exact code but sth to this effect) Dim $array[5] Dim $array2[4] $array[0] = $array2 _DoSomethingSpecial($array) _DoSomethingSpecial 's function header is _DoSomethingSpecial($a) <<NO ByRef Then when i modify $array[0] in _DoSometingSpecial, it somehow manages to edit BOTH $array2 AND $array[0]!!! Why? Is it because AutoIt uses sort of "pointers" in it's storing mechanism for arrays? ??? #) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
seandisanti Posted March 8, 2006 Share Posted March 8, 2006 I have noticed the following happen: (not exact code but sth to this effect) Dim $array[5] Dim $array2[4] $array[0] = $array2 _DoSomethingSpecial($array) _DoSomethingSpecial 's function header is _DoSomethingSpecial($a) <<NO ByRef Then when i modify $array[0] in _DoSometingSpecial, it somehow manages to edit BOTH $array2 AND $array[0]!!! Why? Is it because AutoIt uses sort of "pointers" in it's storing mechanism for arrays? ??? #) it depends on what's going on in _DoSomethingSpecial... Link to comment Share on other sites More sharing options...
PsaltyDS Posted March 8, 2006 Share Posted March 8, 2006 I have noticed the following happen: (not exact code but sth to this effect) Dim $array[5] Dim $array2[4] $array[0] = $array2 _DoSomethingSpecial($array) _DoSomethingSpecial 's function header is _DoSomethingSpecial($a) <<NO ByRef Then when i modify $array[0] in _DoSometingSpecial, it somehow manages to edit BOTH $array2 AND $array[0]!!! Why? Is it because AutoIt uses sort of "pointers" in it's storing mechanism for arrays? ??? #) Strip it down to a minimum amount of working code that will demo the symptom and post it. But, I'll bet in the process you come across the answer anyway. I've done that a couple of times already, found the answer while trying to code a good example of the problem... 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...
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