Jump to content
Sign in to follow this  

Hotkey loop and error handling

Recommended Posts


I start my script with

HotKeySet("^q", "Func1")

While 1

In Func1 I use some error trapping like

If @error = 1 Then 
        MsgBox(0, "Error", "Something went wrong.")

Now what do I use on the place of XXXX?

I don't want to exit the script completely. I just want to go back to the loop waiting for a hotkey to be pressed.

Even more difficult (for me that is :D ) it's getting when I open a file and something goes wrong after I have opened the file. I will need to close it before going back to the hotkey loop, but I don't know how to check if a file is open (if the file handle exists).

Can anybody please shed some light on this?



Share this post

Link to post
Share on other sites

Bedankt, Jos!

That was a lot easier than expected! :wacko:

Now I'l only need to incorporate Eval or IsDeclared in the routines with the file that is open or not, and I am well on my way. :D


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.