乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 106|回复: 4

各位,帮忙看看程序错在哪里?

[复制链接]

4

主题

7

帖子

2

银币

初来乍到

Rank: 1

铜币
23
发表于 2003-5-28 10:59:00 | 显示全部楼层 |阅读模式
dcl文件:
gear:dialog {
label="齿数";
:edit_box {
label="输入齿数";
key="mun";
edit_width=8;
}
:popup_list {
label="模数";
key="mod";
edit_width=8;
}
:edit_box {
label="厚度";
key="hight";
edit_width=9;
}
:edit_box {
label="小圆半径";
key="d";
edit_width=9;
}
ok_button;
}
程序:
;               输入数据
(defun input ()
        (setq p1        (getpoint         "\n输入齿轮的中心点:"))
  
        (setq n1         (GET_TILE       "mun")
              n         (atoi n1))
        (setq mod1        (GET_TILE        "mod")
              mod       (atoi mod1))
        (setq gh1        (GET_TILE        "hight")
              gh        (atoi gh1))
        (setq d11        (GET_TILE       "d")
              d1        (atoi d11))
)
(defun calculating1 ()
    ........)
;主程序
(defun c:gear ()
        (setq it_dcl (load_dialog "gear.dcl"))
        (if (< it_dcl 0)
    (exit)
          )
        (if (not (new_dialog "gear" it_dcl))
    (exit)
  )
      (start_list "mod")     
      (setq modshu '("1" "1.25" "1.5" "2" "2.5" "3" "4" "5" "6" "8" "10" "12" "16" "20" "25" "32" "40" "50"))
      (mapcar 'add_list modshu)
      (end_list)
      (action_tile "accept" "(input)(done_dialog)"
      (start_dialog)
  
        (input)
        (calculating1)
        )
        (prompt "\n输入gear运行程序"))
输入后反馈:
error: bad argument type: stringp nil
回复

使用道具 举报

1

主题

3

帖子

1

银币

初来乍到

Rank: 1

铜币
7
发表于 2003-5-28 12:26:00 | 显示全部楼层
语句(action_tile "accept" "(input)(done_dialog)" 最后少了")",
语句(prompt "\n输入gear运行程序")) 最后多了")"
回复

使用道具 举报

4

主题

7

帖子

2

银币

初来乍到

Rank: 1

铜币
23
发表于 2003-5-28 13:12:00 | 显示全部楼层
也就是
dcl文件:
a:dialog {
label="齿数";
:popup_list {
label="模数";
key="mod";
edit_width=8;
}
ok_button;
}
lisp文件:
(defun c:a()
   (setq it_dcl (load_dialog "a.dcl"))
        (if (< it_dcl 0)
    (exit)
          )
        (if (not (new_dialog "a" it_dcl))
    (exit)
  )
      (start_list "mod")     
      (setq modshu '("1" "1.25" "1.5" "2" "2.5" "3" "4" "5" "6" "8" "10" "12" "16" "20" "25" "32" "40" "50"))
      (mapcar 'add_list modshu)
      (end_list)
  (action_tile "accept" "(input)(done_dialog)")
      (start_dialog)
    (setq mod1        (GET_TILE "mod")
              mod       (atoi mod1))
    (princ mod)
    )
也有同样错误,
怎么办啊,急~~
回复

使用道具 举报

26

主题

3072

帖子

10

银币

社区元老

Rank: 75Rank: 75Rank: 75

铜币
3177
发表于 2003-5-28 16:40:00 | 显示全部楼层
未仔细调试,看错误提示,应该是在INPUT函数中,GET_TILE有些未从对话框中取得正确值[br]
回复

使用道具 举报

11

主题

125

帖子

9

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
169
发表于 2003-6-3 17:16:00 | 显示全部楼层
(defun input ()
  (setq p1 (getpoint "\n输入齿轮的中心点:"))
  (setq        n1 (GET_TILE "mun")
        n  (atoi n1)
  )
  (setq        mod1 (GET_TILE "mod")
        mod  (atoi mod1)
  )
  (setq        gh1 (GET_TILE "hight")
        gh  (atoi gh1)
  )
  (setq        d11 (GET_TILE "d")
        d1  (atoi d11)
  )
)
(defun calculating1 ()
  (princ)
)
                                        ;主程序
(defun c:gear ()
  (setq it_dcl (load_dialog (findfile "gear.dcl")))
  (if (< it_dcl 0)
    (exit)
  )
  (if (not (new_dialog "gear" it_dcl))
    (exit)
  )
  (start_list "mod")
  (setq        modshu '("1"        "1.25" "1.5"  "2"    "2.5"  "3"           "4"
                 "5"        "6"    "8"    "10"   "12"   "16"   "20"
                 "25"        "32"   "40"   "50"
                )
  )
  (mapcar 'add_list modshu)
  (end_list)
  (action_tile
    "accept"
    "(input)(done_dialog)"
    (start_dialog)
    (input)
    (calculating1)
  )
  
)
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-7-27 19:58 , Processed in 0.272452 second(s), 62 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表