几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   ObjectARX(AutoLISP) (http://www.dimcax.com/hust/forumdisplay.php?f=178)
-   -   7text1遇到的问题,麻烦大家了 (http://www.dimcax.com/hust/showthread.php?t=10383)

yang686526 2009-04-25 05:56 PM

7text1遇到的问题,麻烦大家了
 
7text1遇到的问题,麻烦大家了
www.dimcax.com
7text1遇到的问题,麻烦大家了
又来求教了,怎么简单的东西总做不对,来帮忙啊
自动计算整数a加到整数b的总和,但是一load,就显示
命令: (load"7text1")
; 错误: load 失败: "7text1"
(defun c:7test1()
(setq a (getint "input a integer start"))
(setq ab (getint "input a integer end"))

(setq sum a)
(setq nn (- ab a))
(repeat nn

(setq a (+ a 1))
(setq sum (+ sum a))

)
(princ "\n sum") (princ snum)
(prin1)
)
(prompt "\n<<>>sum")
(prin1)
谢谢楼下的帮忙,但是原来是由于马虎把变量弄错了,像这样的错误能通过什么方法发现呢,
希望大家介绍经验。
还有一个小问题,刚刚碰到的,也顺便麻烦一下大家
下面是个循环的一部分,其中的a b cc都点为什么下面的形式屏幕会出现
指定下一点或 [放弃(u)]: c
需要点或选项关键字。
; 错误: 函数被取消
; 出错后重置
(command "line" a b "")
(command "line" b cc "")
但第二行变换了顺序,就运行通了呢
(command "line" a b "")
(command "line" cc b "")
初学问题可能有些幼稚,请保函
d
(defun c:7test1()
(setq a (getint "input a integer start"))
(setq ab (getint "input a integer end"))

(setq sum a)
(setq nn (- ab a))
(repeat nn

(setq a (+ a 1))
(setq sum (+ sum a))

)
(princ "\n sum") (princ sum)
(prin1)
)
(prompt "\n<<>>sum")
(prin1)
工资真的要涨了,心里更加爱党了,能给孩子奖赏了,见到老婆敢嚷了,敢尝海鲜鹅掌了,闲时能逛商场了,遇见美女心痒了,结果物价又涨了!
d


所有的时间均为北京时间。 现在的时间是 11:21 PM.