Title
Left ArrowCheats HomeRight ArrowCheats Misc ListCheats Number ListCheats A ListCheats B ListCheats C ListCheats D ListCheats E ListCheats F ListCheats G ListCheats H ListCheats I ListCheats J ListCheats K ListCheats L ListCheats M ListCheats N ListCheats O ListCheats P ListCheats Q ListCheats R ListCheats S ListCheats T ListCheats U ListCheats V ListCheats W ListCheats X ListCheats Y ListCheats Z List

Home Page

Projects...
PC Controller Box
Joystick Switch Box
c128D Refurb

Programs...
Byte Simulator
Cheat 'O Matic
GEOS

Collections...
3D Models
Book Collection

Information...
My BASIC Notes
Web Links

eMail Me

Note: You must add uk to the end of the address, it's to help prevent spam.

My BASIC Notes

Basic2 Commands
Disk Drives
ASCII and CHR$ Codes
PEEK's and POKE's
RAM Memory Map
ROM Memory Map
Screen Display
Sprite

ASC()
Abbreviation: A <SHIFT+S>

TYPE: Function-Numeric
FORMAT: ASC(<string>)

Action: ASC will return a number from 0 to 255 which corresponds to the Commodore ASCII value of the first character in the string.

EXAMPLES OF ASC Function:

10 PRINT ASC("Z")
20 X = ASC("ZEBRA")
30 J = ASC(J$)

If there are no characters in the string, an ?ILLEGAL QUANTITY error results. In the third example above, if J$="", the ASC function will not work. The GET and GET# statement read a CHR$(0) as a null string. To eliminate this problem, you should add a CHR$(0) to the end of the string as shown below.

EXAMPLE of ASC Function Avoiding ILLEGAL QUANTITY ERROR:

30 J = ASC(J$ + CHR$(0))


Commodore Cheetah made by Allen Monks, started in the year 2000.