Sign in to follow this  
Followers 0
ZetupEXE

Capture AutoIT Error

2 posts in this topic

Hi there,

i've just a little question. When programming some autoit with scite and i.e. an Array has incorrect subscribtion or range exceeded, scite will tell me in which line the error occours. if i have a compiled script there will be a messagebox with autoit headline, and also a line, where the error occured, but the linenumber is much higher than in scite (quess it's because the includes).

how can i have an own errormessage when script is compiled?

thx, for your hints

cu..

Zetup-EXE

Share this post


Link to post
Share on other sites



You should add your own error checking to your code, and some other code to handle it.

Look at @error macro in the help file, which is a massive help.

of you can create your own which is good practice anyway.

For example (and this may not be the best example)

run this script, then uncomment, and run it again.

Local $aNumbers[5] = [1,2,3,4,5]

For $i = 1 To 5
    ;If $i > UBound($aNumbers) -1 Then ;check if the count exceeds the bounds of the array
    ;   MsgBox(0,"error","Unable to proccess count number " & $i )
    ;   Exit
    ;EndIf
    Tooltip($aNumbers[$i])
    Sleep(1000)
Next

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
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
Sign in to follow this  
Followers 0