level 1
绝樊小竣
楼主
(defun sj(kw t / f lis C0 C1 C2 C3 C4 )
(setq f (open "example.DAT" "r"))
(setq loop1 t) (while loop1
(setq lis (read-line f))
(cond ((/= lis nil)
(if (= (strcase kw) (strcase (nth 1 (read lis))))
(progn (close f)
(setq c0 (nth 0 (read lis))
c2 (nth 2 (read lis))
c3 (nth 3 (read lis))
c4 (nth 4 (read lis))
loop1 nil)
);end ofprogn
(setq loop1 t)
);end of if
);cond
((= lis nil) (princ "*error*") (setq loop1 nil))
) );end of cond,while
数据如下
("example.dat" "")
(”序号“ “ 型号” d d1 T1)
( 1 " 51104" "20" "30" "10")
( 2 "51105" "25" "42" "11")
2013年04月11日 05点04分
1
(setq f (open "example.DAT" "r"))
(setq loop1 t) (while loop1
(setq lis (read-line f))
(cond ((/= lis nil)
(if (= (strcase kw) (strcase (nth 1 (read lis))))
(progn (close f)
(setq c0 (nth 0 (read lis))
c2 (nth 2 (read lis))
c3 (nth 3 (read lis))
c4 (nth 4 (read lis))
loop1 nil)
);end ofprogn
(setq loop1 t)
);end of if
);cond
((= lis nil) (princ "*error*") (setq loop1 nil))
) );end of cond,while
数据如下
("example.dat" "")
(”序号“ “ 型号” d d1 T1)
( 1 " 51104" "20" "30" "10")
( 2 "51105" "25" "42" "11")