查看单个帖子
旧 2009-04-26, 02:51 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 [求助]请高手帮帮忙看一下这个程序的问题是什么

[求助]请高手帮帮忙看一下这个程序的问题是什么
www.dimcax.com
[求助]请高手帮帮忙看一下这个程序的问题是什么
不好意思
我现在学习过程中又遇到一个问题
为什么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{

opup_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;
}
d
(while (/= tmp_t nil)
(setq tmp_l (append tmp_l (list tmp_t)))
(setq tmp_l (read-line f_id)) ;这行错了 变量tmp_l应为tmp_t
)
踅摸
d
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)