Newbie: Lisp error handling question

Feb 23, 2004 1 Replies

This is part of a bigger lisp. I am still not familiar how to use error handling. On occassion when I run c:t66 there is no text to be found, so it gives me an error ; error: bad argument type: lselsetp nil When I run (if txt (c:t55)(C:T66)) the lisp will crash. How can I avoid this?



(defun C:t66 () (setq txt (cdr (assoc 1 (entget (ssname (ssget "x" '((0 . "TEXT") (62 . 41))) 0))))))



(defun C:xtt () ;beginning of a bigger lisp (if txt (c:t55)(C:T66)) .......


You need an (if ...) clause in C:t66, in case (ssget "x" '((0 . "TEXT")(62 .

41))) comes up empty (nil). ___

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required