Jump to content
Sign in to follow this  
autoitnewbie123

Error handling

Recommended Posts

autoitnewbie123

How do i do error handling? I have this function which allow me to run .exe. I want to catch all the error handling. What should i do?

@error?

Func installfunc()

MsgBox(0,"","error code:" & @error,"error123")

RunAsWait("","","",1,"hello.exe /SP- /SILENT /VERYSILENT")

MsgBox(0,"","Installation ","Installation Successful")

EndFunc

Share this post


Link to post
Share on other sites
Beege

How do i do error handling? I have this function which allow me to run .exe. I want to catch all the error handling. What should i do?

@error?

Func installfunc()

MsgBox(0,"","error code:" & @error,"error123")

RunAsWait("","","",1,"hello.exe /SP- /SILENT /VERYSILENT")

MsgBox(0,"","Installation ","Installation Successful")

EndFunc

@error tells you if the previous function had any errors or not.. In the example you gave you would check @error after RunAsWait() to see if Hello.exe launched ok. Its not going to tell you if hello.exe had any problems. Only functions written by autoit.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.