Sign in to follow this  
Followers 0
autoitnewbie123

Error handling

2 posts in this topic

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



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  
Followers 0