sunlord Posted March 8, 2007 Posted March 8, 2007 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.
Moderators SmOke_N Posted March 8, 2007 Moderators Posted March 8, 2007 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.
johna007 Posted March 9, 2007 Posted March 9, 2007 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]) How do you get the 'If @error Then Exit' to work? john
Moderators SmOke_N Posted March 9, 2007 Moderators Posted March 9, 2007 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.
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