小白在论坛上抄了一个制作DCL的代码,想修改成计算输入的数字,点击确认后返回计算结果到最后一个空格内,但是完全没有头绪,用了AI帮忙修改都不行,所以来请教一下各位老师,或者提供一下修改的思路,谢谢。- (defun C:WW ()
- (setq dcl_file (open (setq tmp-dcl-file-name (vl-filename-mktemp nil nil ".DCL")) "w"))
- (progn
- (foreach x
- '(
- "ZW:dialog {"
- " label = "计算" ;"
- " :boxed_column {"
- " :edit_box{label = "数A:" ; name = "BH"; height=1;}"
- " :edit_box{label = "数B:" ; name = "JD"; height=1;}"
- " :edit_box{label = "结果:" ; name = "JG"; height=1;}"
- " }"
- " ok_button;"
- " cancel_button;"
- "}"
- ) (write-line x dcl_file) )
- (setq dcl_file (close dcl_file))
- (setq dcl_id (load_dialog tmp-dcl-file-name))
- (if (not (new_dialog "ZW" dcl_id)) (exit)) ;; 激活对话框
- (setq side "") ; 初始化side变量
- (setq AA (start_dialog)) ; 启动对话框
- (if (eq AA 1)
- (progn
- (setq TT1 (getvar "BH"))
- (setq YY1 (getvar "JD"))
- (setq result (* TT1 YY1))
- (setvar "result" (itoa JG))
- )
- )
- )
- )
|