paxtor1994 Posted November 28, 2018 Posted November 28, 2018 Local $x[3] = [2,5,8]; ConsoleWrite($x[0]&@CRLF) ConsoleWrite($x[1]&@CRLF) ConsoleWrite($x[2]&@CRLF) ConsoleWrite($x[3]&@CRLF);here... the code return ^ERROR and the program finish inmediatly ConsoleWrite("This is finished"&@CRLF) Excuse me if not the right place to ask the question but I have the following question: How can I avoid the error of autoit (^ ERROR) Do not abruptly end my program ... how to make a try catch block to follow the next line.
Danp2 Posted November 29, 2018 Posted November 29, 2018 Check out ObjEvent in the help file. Latest Webdriver UDF Release Webdriver Wiki FAQs
Moderators JLogan3o13 Posted November 29, 2018 Moderators Posted November 29, 2018 Moved to the appropriate forum. Moderation Team "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Subz Posted November 29, 2018 Posted November 29, 2018 its kind of simple don't reference variables that don't exist and use error checking in your code otherwise its like writing ConsoleWrite($var + 1 & @CRLF) without actually declaring $var. For example: Local $aArray[] = [9,3,7,2,0,8] If IsArray($aArray) Then For $i = 0 To UBound($aArray) - 1 ConsoleWrite($aArray[$i] & @CRLF) Next EndIf
Malkey Posted November 29, 2018 Posted November 29, 2018 This error, "......au3" (9) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: ConsoleWrite($x[3]&@CRLF) ConsoleWrite(^ ERROR ", is displayed in the output pane of SciTE when the .au3 script is run. Do not try to access an element in the array that does not exist. Either increase the number of elements in the definition, change "Local $x[3]" to "Local $x[4]"; or, Do not use an array index number that exceeds the number of elements in the array. e.g. "Local $x[3]", this array has 3 elements, $x[0], $x[1], and $x[2] - 3 elements. See/Find: The array always starts at index zero.
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