Read a whole line.
The read-line function is similar to the read-char function, but is generally much more practical and efficient to use. Anything can be read from a file, since the format is a string. The file is specified by the file-desc, assigned by the open(open filename mode)(IDR_237) function.
Example
For the following example, assume the file sample.lsp exists, the first line is "C:\Sample\First.txt", and the second line is "Second Line".
Code | Returns |
---|---|
(setq file (open "sample.lsp" "r")) | |
(setq c (read-line file)) | "C:\\Sample\\First.txt" |
(setq d (read-line file)) | "Second Line" |
NOTES
Tell me about...
(setq symbol1 statement1 [symbol2 statement2] ...)
(write-line string [file-descriptor])
Programming Overview of LISP (LISt Processing) Language
Bricscad™ is commercialized by Bricsys NV. Bricsys NV and Vondle NV are fully owned subsidiaries of Menhirs NV. © 2001- Menhirs NV - All rights reserved. |