A. 在LISP中用DCL對話框讀取TXT中的數據
lisp里就直接用lisp函數來讀取文件內容。只需要三個函數,open,close,read-line
Opens a file for access by the AutoLISP I/O
functions
(open filename mode)
Closes an open file
(close file-desc)
Reads a string from the keyboard or from an open
file, until an end-of-line marker is encountered
(read-line [file-desc])
B. lisp如何讀取文件中的數據
先將文本文件用(100
200)這樣表示,每一行一個點,先用read-line讀取,然後用read讀讓它返回一個表即(x坐標
y坐標),然後將一個表付值給一個變數,即可調用了