判断数字为整数,不是的返回一个整数
不知为什么,我输入任何数字都成了不是整数(defun isInt(s)
(cond
((not(= (type s ) 'STR)) nil)
((= (type (read s)) 'INT) T)
(T nil)
)
)
(defun c:tt()
(setq T_scale (getstring "\n 请输入比例:"))
;;(setq T_scale(atof T_scale))
(setq dim_scale(atoi T_scale))
(if (isint dim_scale)
(princ "是整数")
(progn (setq dim_scale 100) (princ "输入的比例非整数,现调整为默认100"))
)
(princ "dim_scale=")(princ dim_scale)
)
为啥 不用getint vectra 发表于 2013-9-5 11:50 static/image/common/back.gif
为啥 不用getint
这个只是测试,因为我原代码是读文本对话框里的文字,并不是输入进来的 已明白,多谢
页:
[1]