(defun Split (str bi-i) (setq j (vl-string-position (ascii "值") str) k (vl-string-position (ascii " ") str) sz (substr str (+ 3 j) (- k j 2)) );setq (set (read(strcat "bl-" (itoa bl-i))) (substr str 1 j)) (set (read(substr str 1 j)) (atof sz)) (setq j nil k nil sz nil);setq 清零 ) ;**********赋值**** (defun c:rea() (setq datefile(getfiled "选择钢管杆的信息文件" "C:/Documents and Settings/Administrator/桌面/" "txt" 2)) (setq ff(open datefile "r")) (setq bl-i 1) (while (setq line (read-line ff)) (split line bl-i) (setq bl-i (+ 1 bl-i)) );while (close ff) (clear) ) ;*********************** (defun clear() (setq i 1) (while (< i bl-i) (setq bl-x (strcat "bl-" (itoa i))) (set (read(read bl-x)) nil);----------------这里,例如bl-1="1d-skj",能不能通过2次的read 把1d-skj=nil呢。 (setq i (1+ i)) ) (setq bl-i nil) ) 我的思路就是bl-1=“1d-skj” 那么read bl-1=1d-skj 从而令1d-skj=nil |