Char2Num

Converts the first character of a string to its numeric equivalent.

Syntax:

Char2Num ( string )

Parameters:

(s) string: any text string. Only the first character will be converted.

Returns:

(i)  ANSI character code.

 

This function returns the 8-bit ANSI code corresponding to the first character of the string parameter.

Note: For the commonly-used characters (with codes below 128), ANSI and ASCII characters are identical.

 

Example:


; Show the hex equivalent of entered character
inpchar = AskLine("ANSI Equivalents", "Char:", "", 0)
ansi = StrSub(inpchar, 1, 1)
ansiequiv = Char2Num(InpChar)
Message("ANSI Codes", "%ansi% => %ansiequiv%")
See Also:

IsNumber, Num2Char