Asc Function

Purpose

Determines the ASCII value of a character in a string.

Syntax

% = Asc(a$ [, offset = 1])

a$:sexp

offset:numeric expression

Description

Asc(a$) returns the ASCII code of the first character in a$. If a$ is blank a 0 is returned. Asc(a$, n) returns the ASCII code of the n-the character in a$.

Example

OpenW # 1

Print Asc("TEST")    //prints 84 since 84 is the ASCII code for T.

Print Asc("TEST", 2) //prints 69 since 69 is the ASCII code for E.

See Also

Mid$()

{Created by Sjouke Hamstra; Last updated: 23/09/2014 by James Gaite}