VLX 应用程序在其自己的命名空间中执行,可以使用 default函数或专门为应用程序定义错误处理程序。*error* 注意:Visual LISP IDE 仅在 Windows 上可用。
如果为在其自己的命名空间中运行的 VLX 定义错误处理程序,则可以调用函数将控制权从 VLX 错误处理程序传递到文档命名空间的函数。vl-exit-with-error*error* 下面的示例用于将字符串传递给文档的函数:vl-exit-with-error*error* (defun *error* (msg) ... ; processing in VLX namespace/execution context (vl-exit-with-error (strcat "My application bombed! " msg))) VLXhandler 可以使用函数将值返回到从中调用 VLX 的文档命名空间。*error*vl-exit-with-value 以下示例用于将整数值 3 返回给从文档命名空间调用 VLX 的程序:vl-exit-with-value (defun *error* (msg) ... ; processing in VLX-T namespace/execution context (vl-exit-with-value 3)) (vl-doc-export 'foo) (defun foo (x) (bar x) (print 3)) (defun bar (x) (list (/ 2 x) x)) 发生错误时挂起的任何指令都将被刷新。 如果 VLX 命名空间错误处理程序不使用 bothor,则控制将在执行错误处理程序后返回到命令提示符。您只能在 VLX 应用程序的错误处理程序的上下文中调用;在任何其他情况下调用这些函数都是错误的。vl-exit-with-errorvl-exit-with-valuevl-exit-with-errorvl-exit-with-value |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )
GMT+8, 2024-5-19 15:57
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.