Reading from a text file
Posted: Wed Nov 26, 2003 10:12 am
For such a seemingly simple task, I am having much difficulty with it. Here is the code...
(defun C:TXTFILE (/ f LINE)
(progn
(setq f (open "TEST.TXT" "r"))
(setq LINE (read-line f))
(close f)
)
(princ))
I'm getting an error when I run that says "; error: bad argument type: FILE nil"
I know it can find the file because I had an if statement alerting me whether or not it found the file. For some reason it's having a hard time reading it.
(defun C:TXTFILE (/ f LINE)
(progn
(setq f (open "TEST.TXT" "r"))
(setq LINE (read-line f))
(close f)
)
(princ))
I'm getting an error when I run that says "; error: bad argument type: FILE nil"
I know it can find the file because I had an if statement alerting me whether or not it found the file. For some reason it's having a hard time reading it.