要保证两个文件在搜索路径里面(如AUTOCAD的安装目录)- (defun c:test( / f str)
- (setq str (getstring "输入字母:"))
- (setq f (open (strcat (substr str 1 1) ".txt") "r"))
- (setq str (strcase str))
- (while (and (setq rl (read-line f)) (/= (read rl) (read str))))
- (close f)
- (if rl
- (princ (cadr (read (strcat "(" rl ")"))))
- (princ "找不到!")
- )
- (princ)
- )
|