Name
Asc -- return code point of character in string
Synopsis
var = Asc(string$[, pos, encoding])
Function
Returns the code point value of the character at index pos in string$. The pos index must be in characters, not in bytes. If the pos argument is omitted, the code point of the first character will be returned.

The optional encoding parameter can be used to set the character encoding to use. This defaults to the default string encoding set using SetDefaultEncoding(). See Character encodings for details.

If you want to work with raw bytes instead of code points, you can either set the encoding parameter to #ENCODING_RAW or use the ByteAsc() function. See ByteAsc for details.

Inputs
string$
input string
pos
optional: index of character whose code point should be returned (defaults to 0) (V7.0)
encoding
optional: character encoding to use (defaults to default string encoding) (V7.0)
Results
var
code point value
Example
result = Asc("A")
Print(result)
This will print "65" which is the code point value of "A".

Show TOC