Jump to content

Recommended Posts

Posted (edited)

Error handlers are important to have especially when you're writing and developing some type of project. If you write the program correctly they shouldn't go off unless something fails which means you have some problem with your code.

If @error = 1 Then MsgBox(0, 'blah', 'error')

Here's an example when I didn't use them but when jos recommended them they came in handy.

 

Edited by aa2zz6
Posted

Actually it's not about syntax errors. My program is complicated and it contains loops that depend on some softwares reactions. What I need is to make my program ignore any error occurred and move to the next step and continue working.

Posted

If you intend to create reliable scripts you should NEVER ignore ANY error.
Catch them, analyze them and then act accordingly. But NEVER ignore anything whithout knowing what you ignore.

If you can post some code and explain where your errors occur we might give further advice.

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted (edited)
  On 5/29/2018 at 10:43 AM, Spartan117 said:

Actually it's not about syntax errors. My program is complicated and it contains loops that depend on some softwares reactions. What I need is to make my program ignore any error occurred and move to the next step and continue working.

Expand  

 

Func _Example_CatchErrors()
    While 1
        _Function1()
        If @error Then ContinueLoop
        While 1
            _Function2()
            If @error Then ContinueLoop
            ExitLoop
        Wend
    Wend
EndFunc

Func _Example_IngoreErrors()
    While 1
        _Function1()
        If @error Then ExitLoop
        While 1
            _Function2()
            If @error Then ExitLoop
        Wend
    Wend
EndFunc

 

btw.
How complicated it is ?

check it using:
 

#Au3Stripper_Parameters=/RM /SO /RSLN /PE

And check ***_stripped.au3 file how many lines and bytes it contains

 

For example:   my biggest project have :       35516 lines and 1 251 423 Bytes

 

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

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
×
×
  • Create New...