ASC()

ASC(S)

RETURNS THE ASCII CODE OF THE FIRST CHARACTER OF STRING S

  • Type: Function
  • Parameter: 1
  • Group: Strings

ACTION

The function ASC(S) returns the ASCII code of the first character of the string expression S.

Remark 1: ASC(S) performs the inverse fonction of CHR$(N).

Remark 2: ASC(S) returns 0 when S is the empty string.

SYNTAX: Result=ASC(S)

  • S = string expression.

USE

  • The function ASC() is used to know the ASCII code of the first character of a string.

ERROR

  • If S is not a correct string expression.

EXAMPLE

print asc("A")

print "Result=65"

SEE ALSO

CHR$()