Nyquist / XLISP 2.0  -  Contents | Tutorials | Examples | Reference

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)              => 48
(char-code #\A)              => 65
(char-code #\a)              => 97
(char-code #\[)              => 91
(char-code #\newline)        => 10
(char-code (code-char 127))  => 127
(char-code (int-char 255))   => 255

Note: In Nyquist/XLISP, 'char-code' and char-int are two different functions, but behave exactly the same [Nyquist 3.03, December 2010].

See also:

  Back to Top


Nyquist / XLISP 2.0  -  Contents | Tutorials | Examples | Reference