Jump to content

Recommended Posts

Posted

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.

Posted

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.
 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...