akorx Posted July 25, 2015 Share Posted July 25, 2015 (edited) Hi my friends !Sometimes, I've not find the reason why, my program (a compliled script) stops working (crash) without error... Is there a way to keep it alive with something like this "on error do nothing" (I've time to find the reason before few weeks) ? Edited July 25, 2015 by akorx AkorxMail akorx@yahoo.fr Link to comment Share on other sites More sharing options...
water Posted July 25, 2015 Share Posted July 25, 2015 Yes, remove the root problem. Honestly. Make your program more reliable so you won't need a 'trick' to restart it after a crash. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
akorx Posted July 25, 2015 Author Share Posted July 25, 2015 Nothing like "on error" ? AkorxMail akorx@yahoo.fr Link to comment Share on other sites More sharing options...
water Posted July 25, 2015 Share Posted July 25, 2015 Not easy to advise without seeing your code. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
jguinch Posted July 25, 2015 Share Posted July 25, 2015 (edited) You can use OnAutoItExitRegister (at the beginning of your code), then you will know if you script ends due to a crash or a logical exit.Example :OnAutoItExitRegister("_OnExitFunc") ; You code.... Func _OnExitFunc() MsgBox(48, "", "Exiting script...") EndFuncWith this code, if the MsgBox appears, then if is not due to a crash but a bad scripting... In this case you can use ShellExecute(@ScriptFullPath) in the _OnExitFunc function to relaunch your script (but it would be really better to determine cause of the exit instead)Edit : as Water said, show your code... Edited July 25, 2015 by jguinch Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
water Posted July 25, 2015 Share Posted July 25, 2015 The function is not called when the script crashes. Check @exitMethod for the supported methods to exit the script. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
jguinch Posted July 25, 2015 Share Posted July 25, 2015 Maybe it is not a crash, but just a normal behavior (just bad coding). It's for this reason I suggest this Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
akorx Posted July 25, 2015 Author Share Posted July 25, 2015 (edited) First, thanks for yours replies guys !I haven't got the script here because it's on computer at work... but it has no "exit" because it runs every time, like an antivirus program. Endeed, it's a program to tile windows, fixe others at the top, etc.I can imagine that the crash of my program appears when I want to resize a window that is not responding (but his process is still there). We can understand behind this, that it's NOT a "normal case". A "normal case" is : the process exists or it doesn't exist, we can verify his state before running the function (resize for example). A zombie process or a process that is not responding is NOT a "normal case". You understand ?So I suppose that we can find a function "ON ERROR" that stops the resize function when it happens in order to keep my program alives, but how can we do this with autoit?PS : sorry for my bad english, I'm french. Edited July 26, 2015 by akorx AkorxMail akorx@yahoo.fr Link to comment Share on other sites More sharing options...
jguinch Posted July 26, 2015 Share Posted July 26, 2015 Your english is not so bad First, I suggest you to post your code here as soon as you can : I'm pretty sure that someone will point out why you script fails.tITo find out the issue by yourself, you can add an ouput comment per line (to the console or a log file). If you can reproduce the problem with the non-compiled script, look at the Trace: Add trace line feature on Scite, it should be usefull to find the faulty line.Il y a plein de français par ici... Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF 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