Returns the ASCII code for a single or the first character of a longer string
Implemented by: dartmouth5, altair8K, a2int, TI994, CBM, Atari, msatari, level2, trscolor, colormc, BBC, GWBASIC, MSX, bwbasic, bw32, ABasiC, QBasic, VBDOS, FreeBASIC, Gambas, ugBASIC, minibasicjs, EndBASIC
With variations:
Also written as: ASCII
C = ASC("h") C = ASC(A$)
The ASC function is
On some BASICs, like #zx81, only a single character is allowed as argument.
The function is called ASCII in #dec10 BASIC.
A very BASIC one to start with.
10 INPUT "DROP ME A WORD"; A$ 20 PRINT "HMM, IT STARTS WITH ASCII CHARACTER"; ASC(A$) 30 END
#Functions
David A. Lien, The BASIC Handbook, 2nd edition.