XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next

char-code


Type:   -   function (subr)
Source:   -   xlstr.c

Syntax

(char-code char)
char - a character expression
returns - the decimal ASCII value as an integer

Description

The 'char-code' function returns the decimal ASCII value of the 'char' expression.

Examples

(char-code #\0)              ; returns 48
(char-code #\A)              ; returns 65
(char-code #\a)              ; returns 97
(char-code #\[)              ; returns 91
(char-code #\newline)        ; returns 10
(char-code (code-char 127))  ; returns 127
(char-code (int-char 255))   ; returns 255

Common Lisp: Common Lisp supports the concept of a complex character that includes not only the ASCII code value, but also fonts and bits. The bits allow for more than 8 bits per character [16 bits is especially useful in oriental languages]. The fonts allow for up to 128 different fonts. This is interesting and neat stuff, however, XLISP does not support fonts and bits.

Note: Because XLISP does not support fonts and bits [as discussed above], 'char-code' and char-int are identical in use.

See the char-code function in the XLISP 2.0 manual.

  Back to Top


XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next