Jump to content

Pls help to provide error trap


muthu123

Recommended Posts

Dear friends,

 

Still i didn't use a error trap in my lisp routines. Now i have forced to do this. So please help. In this Lisp i am calling three major functions each have so many sub fuctions. I want to catch the error in which fuction it happened. Accordingly i can give alert Such like

"The error is in first or Second or third fuction". I could not able to understand the error trap. Please help me.

 

I have

 

(defun c:wtt ()

(sk_general_change_Common_Change)

(sk_Drg_Read)

(Sk_Weight_Calculation_Entity_Selection)

(if (and (/= MARK_loc_1 nil) (/= QNT_loc_1 nil) (/= weight_loc_1 nil))

(progn (convert_data_to_table) (print "Sucessfully Converted"))

(print "There is a missing Information")

)

)

Link to comment
Share on other sites

Error Handlers:

http://www.cadtutor.net/forum/showthread.php?t=33966

http://www.cadtutor.net/forum/showpost.php?p=261049&postcount=3

 

 

Dear Lee,

Thank you for your post and i like you and your geniuos knowledge.

 

What i understand is if any error happen in any of the function during the execution time, it will go to the error trap fucction.It is good. But

I have to find that in which function the error is happen among those three fuctions and i have to give alert to the user accordingly. I remind you that there is so many sub fuctions inside every fuctions.

 

Yours

R.Muthu.

Link to comment
Share on other sites

You could localise an error handler inside more than more function, but if there is an error - why go to all this trouble with the error handlers, why not just code the program properly?

Link to comment
Share on other sites

I put (princ "1") in one sub (princ "2") etc in another and so on and can see which sub its error is in by the screen number usually only have a couple when I have a problem usualy when using ifs or cond and not sure what has happened.

 

Also (princ pt1) see the point answer so know its worked if I get a Nil then I know it hasn't. get it to princ a variable as it runs.

 

Finally remember to remove in final code. its as easy as ;(princ "1")

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