;| 大家帮我看看这样的出错处理应该怎么样写
请不必关注111_temp的具体内容 因为它只是个范例而不是问题的重点
当程序出错以后 系统会调用出错处理函数 程序里重定义了*error* 希望出错以后继续调用111_temp 如果再出错就再调用 (实际程序里有跳过出错环节的处理) 一直到程序正常结束
但是下面的出错语句不能达成愿望 具体表现在 第一次出错时----程序调用出错处理,即调用111_temp 再一次出错时----程序报错退出 大家帮我看看到底是哪里出了问题 1。是这个想法本身不可能实现 2。还是出错语句写得有问题 3。或者出错语句放置的位置有问题
|;
(defun 111_err() (setvar "cmdecho" 0) (setq olderr *error* ) (princ) ) (defun *error*(msg) (setq *error* olderr) (111_temp) (111_no_err) (princ) ) (defun 111_no_err() (setq *error* olderr) (princ) )
(defun 111_temp() (setq p1 (getpoint "\n我要一个点")) (setq p2 (getpoint p1 "\n我还要")) (command "line" "non" p1 "non" p2 "") (setq p3 (getpoint p2 "\n我就是要")) (command "line" "non" p2 "non" p3 "") )
(defun c:111() (load "111.lsp") (111_err) (111_temp) (111_no_err) (princ) ) |