lee321987 Posted February 17, 2020 Share Posted February 17, 2020 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 More sharing options...
TheXman Posted February 17, 2020 Share Posted February 17, 2020 $foo = (FileGetShortcut("C:\bar.lnk"))[0] lee321987 1 CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
lee321987 Posted February 17, 2020 Author Share Posted February 17, 2020 Wow -- I'm so sorry. I feel kind of stupid. Thanks, that worked. Link to comment Share on other sites More sharing options...
TheXman Posted February 17, 2020 Share Posted February 17, 2020 (edited) 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. Edited February 17, 2020 by TheXman lee321987 1 CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
Gianni Posted February 17, 2020 Share Posted February 17, 2020 ..... https://quoteinvestigator.com/2018/05/14/mistakes/ Musashi and lee321987 2 Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now