write-char (AutoLISP)

Writes one character to the screen or to an open file

Supported Platforms: Windows and Mac OS

Signature

(write-char num [file-desc])
num

Type: Integer

The decimal ASCII code for the character to be written.

file-desc

Type: File

A file descriptor for an open file.

Return Values

Type: Integer

The num argument.

Examples

The following command writes the letter C to the command window, and returns the supplied num argument:

(write-char 67)
C67

Assuming that f is the descriptor for an open file, the following command writes the letter C to that file:

(write-char 67 f)
67

Note that write-char cannot write a NULL character (ASCII code 0) to a file.