本帖最后由 ZZXXQQ 于 2014-2-19 08:15 编辑
- (defun c:tt ()
- (setq fn (if (= (type fn) 'STR) fn "")
- (if (setq fn (getfiled "选择文件" fn "txt" 2)) (progn
- (setq fp (open fn "r"))
- (while (and (setq txt (read(read-line fp)) (= (type txt) 'LIST))
- (setq tmp "" i 2)
- (while (/= (setq tmpp (substr txt i 1)) " ")
- (setq tmp (strcat tmp tmpp) i (1+ i))
- )
- (apply 'setvar (list tmp (cadr(read txt))))
- )
- (close fp)
- ))
- (princ)
- )
|