Sign in to follow this  
Followers 0
Bart

Hotkey loop and error handling

3 posts in this topic

I start my script with

HotKeySet("^q", "Func1")

While 1
    Sleep(10)
Wend

In Func1 I use some error trapping like

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

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?

TIA!

Bart

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

Bart

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