明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1991|回复: 4

[基础] 为什么参数太少???

[复制链接]
发表于 2009-11-12 13:29:00 | 显示全部楼层 |阅读模式

(DEFUN C:pma()  (SETQ DCL_ID (LOAD_DIALOG "aaa")) 
 (NEW_DIALOG "aaa" DCL_ID) 

 (ACTION_TILE "accept" "(S_RECT)(DONE_DIALOG)") 
 (START_DIALOG)(UNLOAD_DIALOG) 

 (PRINC))


(DEFUN S_RECT()
(setq fff (atoi (get_tile "pma_type")))
(if (>= fff 0)
(progn
(cond ((= 0 fff)
           (setq kkk (get_tile "pma_pn"))
           (ALERT (STRCAT KKK "YES"))
           )
            ((= 1 fff)
          (setq kkk (get_tile "pma_pn"))
         (ALERT (STRCAT KKK "NO"))
            )
    )))        


 )
(c:pma)

 楼主| 发表于 2009-11-12 13:31:00 | 显示全部楼层

DCL如下

dcl_settings : default_dcl_settings { audit_level = 3; }

aaa : dialog {
    label = "PMA系统";
    : boxed_row {
        label = "打印信息";
        mnemonic = "???";
        : edit_box {
            label = "打印张数";
            key = "pma_pn";
         
        }
        : popup_list {
            label = "纸张类型";
        
            key = "pma_type";
           
            list = "白图\n硫酸纸";
        }
    }
    ok_only;
}

发表于 2009-11-12 17:18:00 | 显示全部楼层
参数传递的问题?
发表于 2009-11-13 19:56:00 | 显示全部楼层

问题解决,修改后代码如下:

(DEFUN C:pma ()
  (SETQ DCL_ID (LOAD_DIALOG "aaa"))
  (NEW_DIALOG "aaa" DCL_ID)
  (ACTION_TILE "accept" "(S_RECT)(DONE_DIALOG)")
  (START_DIALOG)
  (UNLOAD_DIALOG DCL_ID)

  (PRINC)
)

(DEFUN S_RECT ()
  (setq fff (atoi (get_tile "pma_type")))
  (if (>= fff 0)
    (progn
      (cond ((= 0 fff)
      (setq kkk (get_tile "pma_pn"))
      (ALERT (STRCAT KKK "YES"))
     )
     ((= 1 fff)
      (setq kkk (get_tile "pma_pn"))
      (ALERT (STRCAT KKK "NO"))
     )
      )
    )
  )
)

发表于 2010-9-28 10:46:00 | 显示全部楼层
我也遇到这个问题,学习了!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-10-2 12:31 , Processed in 0.176444 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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