Home > Language Reference > String Management Functions > Asc

Asc

The Asc function returns the ASCII code of the first byte in the specified text.

Syntax

var=Asc(<text>)

Parameter

<text>, string.

Return value

var, integer, ASCII value of the first byte in <text>. If <text> is empty or an error occurs, the return value is 0.

See also

Chr$
Encrypt
ExtractBetween$
InStr
InStrRev
LCase$
Left$
Len
LTrim$
Mid$
Replace$
Right$
RTrim$
SplitIntoArray
Str$
Trim$
UCase$
Val

Examples

a=Asc("{")         'returns 123

a=Asc("bcdef")   'returns 98 (ASCII code for "b")