 - ;; By Ayungerstudio 2006.05.11 XI'AN CN
- (defun c:test(/ xlist nlist value zz n)
- (if (= #AY_LISTS nil) (setq #AY_LISTS ""))
- (if (= #AY_VALUE nil) (setq #AY_VALUE 0.0))
- (if (= #AY_FUZZ nil) (setq #AY_FUZZ 0.0))
- (setq xList (getstring T (strcat "\n输入统计数据列表<" #AY_LISTS ">:")));"1.005 1.0055 1.15 1.3 1.88"
- (if (= xList "") (setq xList #AY_LISTS) (setq #AY_LISTS xList))
- (setq xList (read (strcat "(" xList ")")))
-
- (setq nList nil)
- (setq value (getreal (strcat "\n指定统计目标数值<" (rtos #AY_VALUE 2) ">:")))
- (if (= value nil) (setq value #AY_VALUE) (setq #AY_VALUE value))
- (setq zz (getreal (strcat "\n指定比较范围误差值<" (rtos #AY_FUZZ 2) ">:")))
- (if (= zz nil) (setq zz #AY_FUZZ) (setq #AY_FUZZ zz))
-
- (foreach n xlist
- (if (equal n value zz) (setq nList (append nlist (list n))))
- );end_fereach
- (if (/= nlist nil)
- (progn;then
- (princ (strcat "\n结果: 相同元素个数: " (itoa (length nlist)) " 列表:"))
- (princ nlist)
- );end_progn then
- (princ "\n没有与指定值相同的元素存在!");else
- );end_if
- (princ)
- );end_defun
|