07-08-2023, 02:49 AM
(07-07-2023, 01:52 AM)Space_Ghost Wrote: So....CHR$(a) was/is a string, but (a) was a SINGLE in your code so you need to convert it to a string so you can use PRINT at the same time for both (a) and CHR$(a).
I mean this sincerely, BASIC in general is one of the most powerful languages for string manipulations (along with Perl).
Here is the code
:
Here is the output to the console
It really depends which console, or it might be a thing only on Windows. I do this now on Spiral Linux KDE, which is based on Debian v11 (now the "old stable" release) and I get a bunch of question-diamonds, the character that it pulls out when one cannot be represented by the font the terminal is using. The Konsole has to be set to use IBM850 character set, or it won't work as explained.
For those of you who want to try this actually, open Konsole, then from the menu choose "View/Set Encoding/Western European/IBM850". Do not clear the screen nor scrollback or it gets reset to Unicode UTF-8. Probably a profile could be created with the encoding but this has been a PITA because sometimes it ignores the request or it messes up when the user wishes for it to become the default profile, and KDE is taking a long time to fix it.
At other times the Windows-1258 set is chosen such as Notepad++ on Windows, in which CHR$(255) is the lowercase "Y" with dieresis on top of it.
I don't care about Perl but I do know Lua, which also has powerful string manipulations and garbage collection like BASIC does. In addition it has tables which I deeply wish a free dialect of BASIC possessed. I was supposed to look into creating a virtual machine for Lua so a QB64 program could take advantage of Lua regular expressions and associative arrays.