code/2—retrieve the internal numeric representation of a character

The code/2 primitive retrieves the internal numeric representation of a  character.

$INTVAL=code($STRVAL)

code/2 arguments

Argument

Mode

Type

Description

$STRVAL

Input

STRING

Specifies the single character for which you want to return the numeric code

$INTVAL

Output

INTEGER

The numeric code of the character, returned as an integer

Use code/2 to retrieve the internal numeric code of the character specified by the $STRVAL argument and return it as an integer in the $INTVAL argument. The code is implementation-dependent. It currently is the Unicode code point.

code/2 example

$CODE = code($E.msg);
Was this page helpful? Yes No Submitting... Thank you

Comments