The ASC() function takes the first char of a string and returns its numeric PETSCII code. If an empty string is provided, the function will return 0.
The inverse function of ASC() is chr.
DECLARE FUNCTION ASC AS BYTE (char$ AS STRING) SHARED STATIC INLINE
PRINT ASC("a") ' will print 65 PRINT ASC("abc") ' will print 65 PRINT ASC("") ' will print 0