+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Full Member
    Using
    Civil 3D 2014
    Join Date
    Dec 2013
    Location
    Dallas, TX
    Posts
    74

    Default On error checking...

    Registered forum members do not see this ad.

    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

  2. #2
    Full Member
    Using
    Civil 3D 2014
    Join Date
    Dec 2013
    Location
    Dallas, TX
    Posts
    74

    Default

    Is there anybody out there?

  3. #3
    Super Member
    Using
    AutoCAD 2012
    Join Date
    Jun 2012
    Posts
    902

    Default

    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.
    When all you have is a hammer, everything looks like a nail.--

    “Doc, it hurts when I do this.” “Well, don’t do that!”

    “Well, if you don’t know, I’m certainly not going to tell you!”

  4. #4
    Full Member
    Using
    Civil 3D 2014
    Join Date
    Dec 2013
    Location
    Dallas, TX
    Posts
    74

    Default

    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.
    Code:
     (princ  "\nAttention! An error has occurred!") 
        (princ  "\nFWTCAD  RCALC now restoring the user enviroment.")

  5. #5
    Super Member hmsilva's Avatar
    Discipline
    Multi-disciplinary
    Using
    AutoCAD 2016
    Join Date
    Dec 2012
    Location
    Cascais, Portugal
    Posts
    531

    Default

    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

  6. #6
    Full Member
    Using
    Civil 3D 2014
    Join Date
    Dec 2013
    Location
    Dallas, TX
    Posts
    74

    Default

    Thank you hmsilva

  7. #7
    Super Member hmsilva's Avatar
    Discipline
    Multi-disciplinary
    Using
    AutoCAD 2016
    Join Date
    Dec 2012
    Location
    Cascais, Portugal
    Posts
    531

    Default

    Registered forum members do not see this ad.

    You're welcome, LosGirk


    Henrique

Similar Threads

  1. Adding Error Checking or Conditionals (and combining functions)?
    By ILoveMadoka in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 17th Dec 2011, 12:00 am
  2. Need help on Checking a selection set
    By pryzmm in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 17th Nov 2011, 02:50 pm
  3. Clearance checking?
    By Sophisto in forum AutoCAD 3D Modelling & Rendering
    Replies: 7
    Last Post: 4th Jun 2010, 08:14 pm
  4. checking the polylines
    By vivekgrs in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 21st Sep 2006, 05:12 am

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts