LosGirk Posted May 18, 2014 Share Posted May 18, 2014 Is it necessary to put error checking in a program that doesn't change any variables? In other words, does it do more than just the resetting of user settings if a cancel/escape occurs? Thanks Quote Link to comment Share on other sites More sharing options...
LosGirk Posted May 20, 2014 Author Share Posted May 20, 2014 Is there anybody out there? Quote Link to comment Share on other sites More sharing options...
neophoible Posted May 20, 2014 Share Posted May 20, 2014 You don't have to do error checking. It is up to you. However, if the program can go wrong, it helps to have the error checking instead of just crashing or returning nothing, leaving the user confused and frustrated. Quote Link to comment Share on other sites More sharing options...
LosGirk Posted May 21, 2014 Author Share Posted May 21, 2014 Alright thanks neophoible, So if I'm hearing you right, it's good practice to at least have the "An error occurred, user settings reset" line so as to not leave someone hanging and just good cleanly courteousness. Thanks for stepping up. (princ "\nAttention! An error has occurred!") (princ "\nFWTCAD RCALC now restoring the user enviroment.") Quote Link to comment Share on other sites More sharing options...
hmsilva Posted May 21, 2014 Share Posted May 21, 2014 Error handling, is not only to reset system variables, is advisable to use an error handling function whenever we access an external file (txt, xls, ...) to open, to read or to write, to ensure that the file is properly closed on failure, if not, the external file will remain marked as "opened" and to access that file again, you will have to close the AutoCAD session and start a new one... The same is applicable in ObjectDBX and other objects created, to release objects on error... HTH Henrique Quote Link to comment Share on other sites More sharing options...
LosGirk Posted May 22, 2014 Author Share Posted May 22, 2014 Thank you hmsilva Quote Link to comment Share on other sites More sharing options...
hmsilva Posted May 22, 2014 Share Posted May 22, 2014 You're welcome, LosGirk Henrique Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.