CODE

Syntax

CODE (text)
CODE (text, index)

Description

Returns the numeric code representing the first character of the supplied string. If index is used, returns the numeric code representing the character indicated by the index.

Arguments

text Any string.
index Number that refers to the position of a character in text. Starts at 1. This is optional.

Returns

Returns the integer value of the first character of the string. If used with index, returns the integer value of the character in the position listed in index.

Remarks

The numeric code and associated string are defined in your computer's character set.

Examples

CODE ("A")

Returns: 65

CODE ("b")

Returns: 98

CODE ("AbCdE",2)

Returns: 98

Related Topics

Text Functions

Data Conversion

CHAR