Jump to content

Hotkey loop and error handling


Recommended Posts

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...