Jump to content

On error checking...


LosGirk

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

 

8)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...