JohnBailey Posted March 23, 2007 Share Posted March 23, 2007 (edited) Is there a better way to do thisGoal: There are files that AutoIt calls/adjusts that will occasionally cause AUI to "crash" and exit. Granted, ideally the script and the files should never let this happen. However, this has reached more curiosity and would be nice to have as precaution My Method:Opt("OnExitFunc","OnAutoItExit") Global $success = 0 ;do something ;if success then set $success = 1 Func OnAutoItExit() If $success = 1 Then sendemail() Exit EndFuncEdit: Hit enter early Edited March 23, 2007 by JohnBailey A decision is a powerful thing Link to comment Share on other sites More sharing options...
jvanegmond Posted March 23, 2007 Share Posted March 23, 2007 (edited) Is there a better way to do this Goal: There are files that AutoIt calls/adjusts that will occasionally cause AUI to "crash" and exit. Granted, ideally the script and the files should never let this happen. However, this has reached more curiosity and would be nice to have as precaution My Method: Opt("OnExitFunc","OnAutoItExit") Global $success = 0 ;do something ;if success then set $success = 1 Func OnAutoItExit() If $success = 1 Then sendemail() Exit EndFunc Edit: Hit enter early That won't even work.. When AutoIt crashes, it really does crash and doesn't jump to the OnAutoItExit function.. Just rewrite your program in a better fashioned way so that it won't crash. Edited March 23, 2007 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
JohnBailey Posted March 23, 2007 Author Share Posted March 23, 2007 That won't even work.. When AutoIt crashes, it really does crash and doesn't jump to the OnAutoItExit function.. Just rewrite your program in a better fashioned way so that it won't crash.granted. There are times were I'll use a class/UDF (eg yetAnotherExcelCOM and File) and pulls a file. If the file does not contain a given piece of information for those UDFs, AUI gives an error explaining where and pretty much why it happened. While yes I edit these and fix them to avoid these problems, I'd like to possibly eliminate it altogether. Like I said, I'm mostly just curious. There may be super cool things that AUI does that I don't know about (as I learn almost every time I'm on the forums or in the manual just reading around. thanks A decision is a powerful thing Link to comment Share on other sites More sharing options...
Shevilie Posted March 23, 2007 Share Posted March 23, 2007 Nope when it chrash it chrash.. But you can supress errors and then run a function... Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now