不好意思 我现在学习过程中又遇到一个问题 为什么lisp的调用的一个自定义函数不能执行呢?具体怎么调用才是正确的。我这有一个程序在调用addl1 时就不往下运行了 传回一个nil值 高手帮忙看一下 并给一点学习dcl、 lisp的意见,谢谢!!! 下面是程序: (defun c:jg() (setq dcl_id (load_dialog "d:\\LX\\zl.dcl") chk 0) (new_dialog "zl" dcl_id) (addl1) (action_tile "jg_l" "(addl1)") //新增的下拉式選框元件動作 (action_tile "jg_l" "(setq tmp_r (atoi (get_tile \"jg_l\")))(select1)") (setq cd (stof (get_tile "jg_cd")) md (stof (get_tile "jg_md"))) //取得长度编辑框值 (set_tile "jg_zl" "(rtos (* md cd))") //计算其值 (START_DIALOG) (UNLOAD_DIALOG DCL_ID) (PRINC) ) (defun addl1 () (setq j_id (open "d:\\LX\\jg1.txt" "r")) //选取角钢清单表并载入清单 (setq tmp_t (read-line j_id) tmp_l (list "")) (while (/= tmp_t nil) (setq tmp_l (append tmp_l (list tmp_t))) (setq tmp_l (read-line f_id)) ) (close f_id) (setq tmp_l (list (cdr tmp_l))) (start_list "jg_l" 3 0) (mapcar 'add_list (car tmp_l)) (end_list) )
(defun select1 () //选取清单项并传回密度值 (setq f_id (open "d:\\LX\\jg2.txt" "r")) (if (> tmp_r 0) (repeat tmp_r (read-line f_id))) (setq tmp_s (read-line f_id)) (close f_id) (set_tile "jg_md" tmp_s) //把得到的密度值传给密度编辑框 )
zl:dialog{ label="液压工具箱五金手册——重量计算"; :row{ :popup_list{ label="等边角钢"; key="jg_l"; width=25; heigth=8; fixed_width=true; fixed_heigth=true; } :edit_box{ label="单位密度(kg/m)"; key="jg_md"; width=25; heigth=8; fixed_width=true; fixed_heigth=true; value="0"; } :edit_box{ label="长度(m)"; key="jg_cd"; width=25; heigth=8; fixed_width=true; fixed_heigth=true; value="0"; } :edit_box{ label="重量(kg)"; key="jg_zl"; width=25; heigth=8; fixed_width=true; fixed_heigth=true; value="0"; } } ok_only; } |