Jump to content

Select an array from a list


Phaser
 Share

Recommended Posts

Hi Guys

I have a list of arrays

Local $aarray[10],$barray[10],$carray[10]

I want to use the following, or similar to select one of the above arrays to add to

$theletter = "c"

$lastletter = "a"

$whicharray = $lastletter & "array"

_ArrayPush($whicharray,$theletter,1)

_ArrayDisplay($whicharray)

$lastletter = $theletter

In this example I would like arraydisplay to show me the content of $aarray which would contain c

Any help appreciated many thanks

Link to comment
Share on other sites

Ok its not doing what I expected

#include <Array.au3>
HotKeySet("{ESC}", "killit")

Local $aarray[10], $barray[10], $carray[10]
Local $counter = 0

$theletter = "c"
$lastletter = "a"

While $counter < 10

$whicharray = Execute("$" & $lastletter & "array") ; Copy an array to $whicharray

_ArrayPush($whicharray, $theletter, 1)
_ArrayDisplay($whicharray)

$counter = $counter +1

WEnd

Func killit()
    Exit
EndFunc

I expect it to keep adding the letter c so the whole array contains 10 c's, what am I doing wrong?

Edited by Phaser
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...