WPerciful 发表于 2022-7-6 00:03:06

你怎么跳到最后?

在一个函数中,你如何使它不进一步?下面的代码没有退出该函数。
 
        (if (or (= dir (getroot)) (= dir (strcat (getroot) "\\Titleblocks")))
        (progn
                (princ "\nHey you’re not allowed to delete files from this folder! ")
                end
        )
)
 
显然,结局并不像我想象的那样。

hmsilva 发表于 2022-7-6 00:25:10

尝试:

(exit)
or
(quit)

 
亨里克

WPerciful 发表于 2022-7-6 00:39:00

 
非常感谢你!

hmsilva 发表于 2022-7-6 01:02:45

不客气!
 
亨里克

MSasu 发表于 2022-7-6 01:04:13

请注意,一个好的编程实践是在使用退出/退出进行更干净的退出时添加错误陷阱。或者可以按如下方式构建代码,尽管这可能会使代码过载。
(if (not (or (= dir (getroot))
            (= dir (strcat (getroot) "\\Titleblocks"))))
(progn
;;;your main code here
)
(progn
(princ "\nHey you’re not allowed to delete files from this folder! ")
)
)
页: [1]
查看完整版本: 你怎么跳到最后?