明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1069|回复: 1

[求助]请高手帮帮忙看一下这个程序的问题是什么

[复制链接]
发表于 2008-10-21 20:16 | 显示全部楼层 |阅读模式

不好意思

我现在学习过程中又遇到一个问题

为什么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;
          }

发表于 2008-10-23 09:12 | 显示全部楼层

 (while (/= tmp_t nil) 
    (setq tmp_l (append tmp_l (list tmp_t))) 
    (setq tmp_l (read-line f_id))  ;这行错了 变量tmp_l应为tmp_t
 ) 

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-5-3 16:23 , Processed in 2.810946 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表