Sign in to follow this  
Followers 0
nfwu

Question about arrays in arrays in arrays.......

3 posts in this topic

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?

???

#)

Share this post


Link to post
Share on other sites



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...

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

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. :geek:

I've done that a couple of times already, found the answer while trying to code a good example of the problem... :o


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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0