Jump to content

Get element from array returned by a command without assigning the array to a variable


 Share

Recommended Posts

Is it possible to get the value an element from an array without assigning the array first?

Example:  FileGetShortcut() returns an array.  If I only need the first element of that array, I would like a single-command to only retrieve the first element.

Normally I would do this:
 

$foo = FileGetShortcut("C:\bar.lnk")

$foo = $foo[0]

The following code won't work, but it shows what I wish I could do:

$foo = FileGetShortcut()[0]

 

Link to comment
Share on other sites

Link to comment
Share on other sites

No need to apologize.  I learn something new about AutoIt all the time and I've been using it almost daily for over 12 years.  :ILA3:

:thumbsup:

Edited by TheXman
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...