Jump to content

Array question


Recommended Posts

  • Moderators

Is there any way to return the contents of a particular element in an Array? For example if I type in 3 in an Input box, I should get the contents of the 3rd element in the Array.

Dim $aArray[4] = ['Nothing','Really','Special','Here']
$nNum = InputBox('Number', 'Enter a number between 0 and 3', '', '', 100, 80)
If @error Then Exit
MsgBox(64, 'Info', '$aArray[' & $nNum & '] = ' & $aArray[$nNum])

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

Failure: Returns "" (blank string) and sets @error as follows:

@Error 0 = The string returned is valid.

1 = The Cancel button was pushed.

2 = The Timeout time was reached.

3 = The InputBox failed to open. This is usually caused by bad arguments.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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...