Jump to content

Opt("OnExitFunction",?)


 Share

Recommended Posts

I'm trying to make an OnExitFunction which cleans up the temporary files it created if it finds half way through that it can't process the rest. Insufficient file/directory privaliges can cause this, and it's not just a matter of being an Admin. I can't test for it before I've created the Temporary files, because they will determine what directories and files you need to have write privalages for. My script will become very large if I need to write cleanup code for all the places it might fail so an OnExitFunction is ideal. (GoTo would do but it's only for onerror GoTo)

Trouble is all the other Opt() functions need an Option name as String and a parameter as number. How do I set the parameter of Opt() for the "OnExitFunction" option? The help files description:-

OnExitFunc Sets the name of the function called when AutoIt exits (default is OnAutoItExit).

Isn't particulaly helpful as the line:-

Opt("OnExitFunction",OnAutoItExit)

or

Opt("OnExitFunction","OnAutoItExit")

Fails too. :lmao:

Anybody get this fascility to work who can provide a good example?

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...