Qbasicnews.com

Full Version: Chr codes
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Where can I get a list of all the CHR$ equivelants? I need one badly.
The QB help, ASCII Char Codes:

Help->Content->ASCII Character Codes


Big Grin
There is also a list at http://qbasicnews.com/qboho/qckadvr.ac.shtml but it uses windows codes not dos(I think) as there are some missing. I think I'll put up a image capture of the screen as well.
You could also use:
ASC()

Which is the oposite of CHR$()
Another way to find them is to make your own list as follows:

' ***** OPTIONAL PRINT TO DISK *****
OPEN "CHRCODE" FOR INPUT AS 1

CLS (optional)
FOR N = 1 TO 255
PRINT "THE CHR$ CODE FOR ASCII ";N ;" IS ";CHR$(N)

' ***** OPTIONAL PRINT OUT TO PRINTER *****
LPRINT " ASCII ";N; " = "; CHR$(N)

' ***** OPTIONAL PRINT TO DISK *****
PRINT #1, " ASCII "; N; " = "; "CHR$(N) ";CHR$(N)

' *****OPTIONAL TIMER *****
FOR T = 1 TO 500
NEXT T
NEXT N
CLOSE 1

Of course you can eliminate any or all of the optional items you wish and/or increase or decrease the time for the timer as well.
This was done up mainly from memory, but I think it's right.
This is just another option for you.