Since a lot of folks here didn't seem to know about QB64's in-built ASCII chart, I can only assume that they also don't know the history of the chart...
When I was working on my IDE several years back, I tried to think of all the features that I'd like for it to have that QB64 didn't have. The ASCII chart was one of those features, as well as the Math Calculator which is currently used for both CONST evaluation and the Math function available under Help.
Once I'd gotten them working in StevesIDE, I made certain to make them as portable as I possibly could, and then I worked around with adding them into QB64 for everyone. At first, both routines used external calls to stand-alone programs, which QB64 shelled out to, and then used the SHELL return value inside QB64 itself. You can still see the comment where this happened if you look inside the QB64 source at the current version of ideASCIIchart:
'IF INSTR(_OS$, "WIN") THEN ret% = SHELL("internal\ASCII-Picker.exe") ELSE ret% = SHELL("internal/ASCII-Picker")
This worked fine back in the SDL days, but somehow it got broken for Linux users once we swapped to over to the GL version. You could select SPACE (value 32) in Linux, and sometimes it'd give a return value of 214, or something equally odd. That glitch was never sorted out properly, as it seemed OS specific to certain versions of Linux only, and instead the ASCII chart was modified to work directly with QB64's internal strings -- which is how it currently exists today. (Whether SHELL's return values are still broken for Linux, I couldn't tell you. Somebody else, with a Linux machine, would have to test that out to see.)
Personally, I like the in-built ASCII chart QB64 has. Gives values as well as being clickable and selectable! Found happily enough under the Help tab, on the top right of the IDE.
Oh my goodness, I did not even see this, LOL. Yes, it is handy. Is there a way it can be made to appear without losing the code window though?
Since folks have been asking about making it appear without losing the code window, that's a simple enough request which I can easily give a response to:
SURE IT CAN!! WOOT!!WOOT!!After all, it was an external program, completely independent to QB64 itself, to begin with....
_TITLE "External ASCII Picker" f
= _LOADFONT("cour.ttf", 128) 'a nice large display font, not a 100% match to QB64's inbuilt version,_FONT f
' but it works easily here for a demo highlight character
IF temp
= 0 THEN 'static backgrounds so we don't have to make them over and over, or worry about freeing them LINE (x
* 40, 0)-(x
* 40, 480), _RGB32(255, 255, 0) LINE (0, y
* 30)-(640, y
* 30), _RGB32(255, 255, 0) counter = counter + 1
counter = 0
LINE (x
* 40, 0)-(x
* 40, 480), _RGB32(255, 255, 0) LINE (0, y
* 30)-(640, y
* 30), _RGB32(255, 255, 0) counter = counter + 1
x = 1: y = 1
x
= _MOUSEX \
40 + 1 'If mouse moved, where are we now?
num = (y - 1) * 16 + x - 1
text$ = ""
flashcounter = flashcounter + 1
IF LEN(text$
) = 1 THEN text$
= " " + text$
+ " " IF flashcounter
= 60 THEN flashcounter
= 1 LINE (x
* 40 - 40, y
* 30 - 30)-(x
* 40, y
* 30), _RGBA32(255, 255, 255, 150), BF
MouseClick = 0: MouseExit = 0
ret% = (y - 1) * 16 + x - 1
cleanexit:
Run the above and we get the ASCII Chart we all know and love. (And if someone didn't know it, they do now, and I'm certain they'll love it...) Choose a character, it'll copy to your clipboard, where it should paste into whichever program you need it to -- including QB64.
It's not quite as simple as Click-To-Insert, as it's Click-To-Clipboard, but it does have the added advantage of staying up for those times when you simply need to know what character corresponds to what value. Feel free to save it and use it for all you ASCII needs. :)
Edit: Cleaned up the code just a bit since it doesn't have to work just for SCREEN 0, like with QB64's IDE. Also loaded a larger font for display purposes, just for the heck of it. :P