muthu123 Posted May 12, 2010 Share Posted May 12, 2010 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") ) ) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 12, 2010 Share Posted May 12, 2010 Error Handlers: http://www.cadtutor.net/forum/showthread.php?t=33966 http://www.cadtutor.net/forum/showpost.php?p=261049&postcount=3 Quote Link to comment Share on other sites More sharing options...
muthu123 Posted May 13, 2010 Author Share Posted May 13, 2010 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. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 13, 2010 Share Posted May 13, 2010 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? Quote Link to comment Share on other sites More sharing options...
BIGAL Posted May 14, 2010 Share Posted May 14, 2010 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") 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.