Jump to content

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


Go to solution Solved by UEZ,

Recommended Posts

Posted

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

  • Solution
Posted

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Posted (edited)

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

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

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

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
  • Recently Browsing   0 members

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