ASC

Function

ASC returns the decimal ASCII value of the first character of a string variable. For a list of ASCII codes used with HUNTER Basic see ASCII Character Set.

Syntax

ASC("STRING")

Examples

Y = ASC(X$(3))

PRINT ASC("A")

will print 65

10 T$="AB"
20 PRINT ASC(T$)

will also print 65, since "A" is the first character.

Remarks

The string argument must be enclosed in parentheses.

ASC is particularly useful for detecting special characters like control codes, and/or distinguishing them from digits 0-9 or characters A-Z.