(write-char)

(write-char character [file-descriptor])


Write that character to a file.


This function write a character to a file. The file is specified by the file-descriptor, assigned by the open function. This function writes characters that are in ASCII code. You convert a letter to its ASCII code with the (equal statement1 statement2 [tolerance])(IDR_166)(ascii string)(IDR_128) function. When the file-descriptor is left out, the character is written to the command line and Prompt History window.

NOTE The write-line, function, whose format argument is a string, is often more practical and efficient to use than the write-char function.

Example

Code Returns Prints in File
(setq fil (open "sample.lsp" "w")) (write-char (ascii "b") fil)) 98 b

Tell me about...

(chr integer)

(read-char [file-descriptor])

(write-line string [file-descriptor])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language