Jump to content
Sign in to follow this  
gil900

Is there a better way to read variable from this complicated array ?

Recommended Posts

gil900

Hello,

I have this type of array:

Local $MainArray[5][6] , $SubArray[5]
$SubArray[2] = "Work"
$MainArray[3][2] = $SubArray

Now i want to get the "work" string from the $MainArray.

The only way I know is this:

$tmp = $MainArray[3][2]
MsgBox(0,"",$tmp[2])

But I do not like this way.

I do not want to use a temporary variable to get this information.
I tried to do it in this way:

MsgBox(0,"",$MainArray[[3][2]][2])

I guessed that it should work .. but unfortunately it did not work.
Is there a syntax method to do
what I'm trying to achieve?

 


Thank for helpers

Share this post


Link to post
Share on other sites
UEZ

Try this:

Local $MainArray[5][6] , $SubArray[5]
$SubArray[2] = "Work"
$MainArray[3][2] = $SubArray

ConsoleWrite(($MainArray[3][2])[2] & @CRLF)

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites
Chimp

this should work:

ConsoleWrite(($MainArray[3][2])[2] & @cr) ;<-- Works from AutoIt Beta v3.3.9.18

have a look >here

edit

opsss... UEZ is a speedy typer

Edited by Chimp
  • Like 1

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

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  

×