QB64 Phoenix Edition - BASIC programming language
Posted: 15 Sep 2022, 23:25
QB64 Phoenix Edition is a front end to "g++" which allows writing code that is nearly 100% compatible with M$ QuickBASIC v4.5 (interpreter and compiler) and with QBasic (interpreter). The language was extended to support loading images and music, for Internet functionality and for safe memory management. The system comes with an IDE which is similar to that of QuickBASIC. It has a help system discussing the keywords, data types and a few other things about the programming language. It does active syntax checking, and could be configured for appearance and debugging. The editor is slow and a bit tedious to use, however. Instead you could compose your programs with your favorite source code editor.
Very important! Almost forgot to say this: on Porteus the "05-devel.xzm" module is required activated.
Note there are multiple flavors of QB64 around but the Phoenix Edition is the one being actively developed at this time. Recently QB64PE regained the ability to load and play back ancient tracker modules such as MOD and IT; for a long time MP3, OGG (OGG Vorbis) and WAV were supported. At this time the team is working on MIDI file support which includes Soundfont integration into an user's executable file.
Not all code could be ported. There is code floating around for M$ BASIC Professional Development System v7.1 and for Visual Basic for DOS v1.0 (thought of as the M$QB v5) which has a few things like currency data type, "DIR$()" function and the ISAM database support, which are not portable to QB64. Cannot load "LIB" nor "QLB" files created by QuickBASIC compiler, or for "QBX" program that came with BASIC PDS v7.1. The source code for those has to be recompiled by QB64. QB64 Phoenix Edition is not an event-driven programming language, is not an object-oriented programming language (yet) and doesn't support kits to create GUI programs as known so well on later versions of Visual Basic for Windows.
The user has to be aware of some feats with QBasic in particular. For example, what relies too much on old BIOS and MS-DOS interrupts because it was refactored in WindowsXP and M$ expected programmers then to use Win32 API calls instead. Programs that have too much of words like "ABSOLUTE", "DEF SEG", "DEF FN", "POKE", "SADD" etc. will have to be modified. A program that allows changing the "DATE$" or "TIME$", of course, cannot be ported to Linux. There are a few other things that have yet to be supported on Linux, like replicating AutoHotKey faking keyboard and mouse gestures with "_SCREENCLICK" and "_SCREENPRINT". That said, whatever a beginner or an intermediate BASIC programmer could come up with, QB64 Phoenix Edition could handle.
Please read the Wiki, in the "Frequently Asked Questions" for example to guard about games written in QBasic which use "FOR... NEXT" loops or the like for delaying. One of them was the "QBasic Nibbles" that came with that interpreter and the rest of MS-DOS v5. Should instead use "_DELAY" or "_LIMIT" to keep CPU usage sensible.
Download only from the provided link. As I've said, there are other "versions" of QB64 but they have different levels of "progress" and are by different teams. There is no "official" version of QB64; that has died because the original author, Galleon is no longer involved in the project. The Phoenix Edition development is still being guided by the rules he set forth before he retired. If a package such as DEB, RPM or other "popular file suffix" appears, don't touch it unless it does come from the QB64 Phoenix Edition.
Forum which has a link to be invited into Discord.
Note: I'm not advertising here and I'm not one of the contributors of QB64 Phoenix Edition. I'm only sharing an application which might make life easier for somebody coding in C++ or Python or something else, or might want to make a simple game or graphics/sound demonstration. Sorry if this is TL;DR
In case you're interested in creating programs with this system and want to run them in Slackware, the following libraries would be required:
libGL.so.1
libGLU.so.1
libX11.so.6
libc.so.6
libgcc_s.so.1
libm.so.6
libstdc++.so.6
libz.so.1
The last one, for "zlib" isn't actually listed by "readelf" but might be required for use of "_DEFLATE$" and "_INFLATE$", which are commands that mimic "gzip" functionality for strings. I've done the check on "qb64pe" executable itself built on Porteus and on at least two programs created with it.
__________
I patched "libqb.cpp" to use "zenity" instead of "xmessage" so an user program is able to report runtime errors on a different Linux distro. This is important for debugging. Originally QB64 was only for Windows but the first author decided to make it portable, and therefore the "MessageBox()" Win32 API call had to be covered for different operating systems. There was no way to acquire "xmessage" in the other distro, as unbelievable as this might seem. Its dialog is a bit ugly and might be too small for some of you who have large screens. After it's dismissed, a complaint (unrelated to the user program) could appear on the terminal, which is annoying. What if you want to use "zenity" dialog instead? ROFL Please tell me that you want to on KDE Plasma where everything else looks pretty and it seems to be what everyone wants. Then make the following changes:
Beginning with line 2612 there is this sequence:
Change that "// whatever" to:
Starting on line 2640 there is another bunch of lines:
"// change me" should be modified to:
Then rebuild QB64PE.
Very important! Almost forgot to say this: on Porteus the "05-devel.xzm" module is required activated.
Note there are multiple flavors of QB64 around but the Phoenix Edition is the one being actively developed at this time. Recently QB64PE regained the ability to load and play back ancient tracker modules such as MOD and IT; for a long time MP3, OGG (OGG Vorbis) and WAV were supported. At this time the team is working on MIDI file support which includes Soundfont integration into an user's executable file.
Not all code could be ported. There is code floating around for M$ BASIC Professional Development System v7.1 and for Visual Basic for DOS v1.0 (thought of as the M$QB v5) which has a few things like currency data type, "DIR$()" function and the ISAM database support, which are not portable to QB64. Cannot load "LIB" nor "QLB" files created by QuickBASIC compiler, or for "QBX" program that came with BASIC PDS v7.1. The source code for those has to be recompiled by QB64. QB64 Phoenix Edition is not an event-driven programming language, is not an object-oriented programming language (yet) and doesn't support kits to create GUI programs as known so well on later versions of Visual Basic for Windows.
The user has to be aware of some feats with QBasic in particular. For example, what relies too much on old BIOS and MS-DOS interrupts because it was refactored in WindowsXP and M$ expected programmers then to use Win32 API calls instead. Programs that have too much of words like "ABSOLUTE", "DEF SEG", "DEF FN", "POKE", "SADD" etc. will have to be modified. A program that allows changing the "DATE$" or "TIME$", of course, cannot be ported to Linux. There are a few other things that have yet to be supported on Linux, like replicating AutoHotKey faking keyboard and mouse gestures with "_SCREENCLICK" and "_SCREENPRINT". That said, whatever a beginner or an intermediate BASIC programmer could come up with, QB64 Phoenix Edition could handle.
Please read the Wiki, in the "Frequently Asked Questions" for example to guard about games written in QBasic which use "FOR... NEXT" loops or the like for delaying. One of them was the "QBasic Nibbles" that came with that interpreter and the rest of MS-DOS v5. Should instead use "_DELAY" or "_LIMIT" to keep CPU usage sensible.
Download only from the provided link. As I've said, there are other "versions" of QB64 but they have different levels of "progress" and are by different teams. There is no "official" version of QB64; that has died because the original author, Galleon is no longer involved in the project. The Phoenix Edition development is still being guided by the rules he set forth before he retired. If a package such as DEB, RPM or other "popular file suffix" appears, don't touch it unless it does come from the QB64 Phoenix Edition.
Forum which has a link to be invited into Discord.
Note: I'm not advertising here and I'm not one of the contributors of QB64 Phoenix Edition. I'm only sharing an application which might make life easier for somebody coding in C++ or Python or something else, or might want to make a simple game or graphics/sound demonstration. Sorry if this is TL;DR
In case you're interested in creating programs with this system and want to run them in Slackware, the following libraries would be required:
libGL.so.1
libGLU.so.1
libX11.so.6
libc.so.6
libgcc_s.so.1
libm.so.6
libstdc++.so.6
libz.so.1
The last one, for "zlib" isn't actually listed by "readelf" but might be required for use of "_DEFLATE$" and "_INFLATE$", which are commands that mimic "gzip" functionality for strings. I've done the check on "qb64pe" executable itself built on Porteus and on at least two programs created with it.
__________
I patched "libqb.cpp" to use "zenity" instead of "xmessage" so an user program is able to report runtime errors on a different Linux distro. This is important for debugging. Originally QB64 was only for Windows but the first author decided to make it portable, and therefore the "MessageBox()" Win32 API call had to be covered for different operating systems. There was no way to acquire "xmessage" in the other distro, as unbelievable as this might seem. Its dialog is a bit ugly and might be too small for some of you who have large screens. After it's dismissed, a complaint (unrelated to the user program) could appear on the terminal, which is annoying. What if you want to use "zenity" dialog instead? ROFL Please tell me that you want to on KDE Plasma where everything else looks pretty and it seems to be what everyone wants. Then make the following changes:
Beginning with line 2612 there is this sequence:
Code: Select all
if (type == MB_YESNO) {
// whatever
static int status;
Code: Select all
qbs_set(s,qbs_new_txt("zenity --question --window-icon=question --ok-label=YES --cancel-label=NO --no-wrap --title="));
qbs_set(s,qbs_add(s,qbs_new_txt("?"))); s->chr[s->len-1]=34;
qbs_set(s,qbs_add(s,qbs_new_txt(title)));
qbs_set(s,qbs_add(s,qbs_new_txt("?"))); s->chr[s->len-1]=34;
qbs_set(s,qbs_add(s,qbs_new_txt(" --text=")));
qbs_set(s,qbs_add(s,qbs_new_txt("?"))); s->chr[s->len-1]=34;
qbs_set(s,qbs_add(s,qbs_new_txt(title)));
qbs_set(s,qbs_add(s,qbs_new_txt(" : ")));
qbs_set(s,qbs_add(s,qbs_new_txt(message)));
qbs_set(s,qbs_add(s,qbs_new_txt(" ")));
qbs_set(s,qbs_add(s,qbs_new_txt("?"))); s->chr[s->len-1]=34;
qbs_set(s,qbs_add(s,qbs_new_txt("?"))); s->chr[s->len-1]=0;
Code: Select all
if (type == MB_OK) {
// change me
system((char *)s->chr);
Code: Select all
qbs_set(s,qbs_new_txt("zenity --error --window-icon=error --no-wrap --title="));
qbs_set(s,qbs_add(s,qbs_new_txt("?"))); s->chr[s->len-1]=34;
qbs_set(s,qbs_add(s,qbs_new_txt(title)));
qbs_set(s,qbs_add(s,qbs_new_txt("?"))); s->chr[s->len-1]=34;
qbs_set(s,qbs_add(s,qbs_new_txt(" --text=")));
qbs_set(s,qbs_add(s,qbs_new_txt("?"))); s->chr[s->len-1]=34;
qbs_set(s,qbs_add(s,qbs_new_txt(title)));
qbs_set(s,qbs_add(s,qbs_new_txt(" : ")));
qbs_set(s,qbs_add(s,qbs_new_txt(message)));
qbs_set(s,qbs_add(s,qbs_new_txt(" ")));
qbs_set(s,qbs_add(s,qbs_new_txt("?"))); s->chr[s->len-1]=34;
qbs_set(s,qbs_add(s,qbs_new_txt("?"))); s->chr[s->len-1]=0;