Computing: DOS, OS/2 & Windows Programming

BASIC programming: Alternatives to Microsoft Visual Basic.

Visual Basic (VB) is an event-driven programming language and environment from Microsoft that provides a graphical user interface (GUI), which allows programmers to modify code by simply dragging and dropping objects and defining their behavior and appearance (RAD = rapid application development). VB is derived from the BASIC programming language and is considered to be event-driven and object-oriented. Visual Basic is intended to be easy to learn and fast to write code with. It is frequently used to prototype an application that will later be written in a more difficult but more efficient language. The last version of VB, Visual Basic 6, was released in 1998, but has since been replaced by Visual Basic .NET, Visual Basic for applications (VBA) and Visual Studio .NET. VBA and Visual Studio are the two frameworks most commonly used today. For further InFormation concerning Visual Basic, you might want to visit the Visual Basic (VB) page at the techtarget.com/whatis website. The documentation, with download links, tutorials, and language reference may be viewed (also available as PDF download) on the Visual Basic documentation page on the Microsoft .NET website.

This document presents some other modern BASIC development environments, that may be seen (globally, or for given applications development) as alternatives to VB. It is not a professional rating of BASIC software, but my own personal experiences and thoughts when trying them out on Windows 10 (actually the light-version Windows 10 Potato).

FreeBASIC.

"FreeBASIC is a free BASIC compiler for Windows (32-bit and 64-bit), 32 bit protected-mode DOS (COFF executables, like DJGPP), and Linux (x86, x86_64, and ARM). It began as an attempt to create a code-compatible, free alternative to Microsoft QuickBASIC, but has quickly grown into a powerful development tool, already including support for libraries such as Allegro, SDL, OpenGL, and many others with its default installation. Aside from having a syntax mostly compatible with QuickBASIC, FreeBASIC introduces several new features to the aged language, including pointers to variables and functions, and unsigned data types."

FreeBASIC has a lot of fans all over the world. I spent some time to try it out, and got to the conclusion that it is a more than interesting development tool for all those, who long years ago worked or played with QuickBASIC and want to review the command line programs, that they wrote in the past, on Windows 10 or 11, as well as for those, who know the QuickBASIC programming language and search for a possibility to use this knowledge to create GUI applications for the latest versions of MS Windows. For further details, please, have a look at my tutorial Developing FreeBASIC applications on Windows 10, that contains details about the installation and usage of FreeBASIC, CSED_FB (FreeBASIC IDE), FBMath (FreeBASIC mathematics library), about accessing the Windows API, and about VisualFBEditor (FreeBASIC RAD environment). It also includes the description (GUI design, source code) of a simple project (Windows desktop application), created with VisualFBEditor.

PowerBASIC.

PowerBASIC is another BASIC flavor, widely used by developers using the BASIC programming language. There is not lot of InFormation concerning the comparison of PowerBASIC with PureBasic or FreeBASIC available on the Internet. It seems that lots of people use it because of its stability.

Here is how Wikipedia describes it: "PowerBASIC, formerly Turbo Basic, is the brand of several commercial compilers by PowerBASIC Inc. that compile a dialect of the BASIC programming language. There are both MS-DOS and Windows versions, and two kinds of the latter: Console and Windows. The MS-DOS version has a syntax similar to that of QBasic and QuickBASIC. The Windows versions use a BASIC syntax expanded to include many Windows functions, and the statements can be combined with calls to the Windows API."

PowerBASIC is a commercial product (there is a free trial version available, I think), so without interest for people living in the street, or other people, who need their money for having something to eat and to smoke (to smoke and to eat, in my case). The complete bundle of PowerBASIC v10 was announced end 2023 at $175 at the product website. If you want to give it a try, here is the link to the PowerBASIC website.

PureBasic.

"PureBasic is a modern BASIC programming language. The key features of PureBasic are portability (Windows, Linux, OS X and Raspberry supported with the same source code), the production of very fast and optimized native 32-bit or 64-bit executables and, of course, the very simple BASIC language syntax. PureBasic has been created for the beginner and expert alike. We have put a lot of effort into its conception to produce a fast, reliable system and friendly BASIC compiler.", they describe PureBasic on the product website. Among its features, we have a huge set of internal commands (1600+) to quickly and easily build applications or games, full OS API access, easy but very fast 2D game support through dedicated libraries (DirectX, OpenGL), easy and high quality 3D support based on OGRE, full Unicode support, inline assembly...

There is not lot of InFormation concerning the comparison of PureBasic with PowerBASIC or FreeBASIC available on the Internet. It seems that lots of people prefer it over PowerBASIC because they find its syntax easier; others say that it's faster. PureBasic seems to be the favorite of many BASIC programmers, when the project concerns game programming. Compared to FreeBASIC, available functionalities and performance are mostly qualified as similar. The big difference is that FreeBASIC is open source and freeware, whereas the PureBasic code is proprietary (Fantaisie Software) and the full version of the product requires a commercial license. Good news, however: There is a free version of PureBasic available. On the product website, they call it "demo version", what I find a really bad term. In fact, it's not a demo, but a fully functional BASIC development environment, certainly with limitations, but usable without time limits, and the possibility to create executables that properly run without external DLLs, runtime interpreter or anything else required on the target machine. Among the limitations of the free version, we have:

To download the Windows installer, please, visit the PureBasic website. You may also want to search the Internet in order to find the PDF version of the PureBasic Reference Manual and a book called PureBasic - A Beginner’s Guide to Computer Programming.

PureBasic is shipped with an IDE with, of course PureBasic syntax highlighting and checking. The GUI allows to create PureBasic projects, to run and debug them (interpretation), as well as to create executables (compilation). As said above, the executables created include everything needed to be run on another machine.

The installation files also include help documentation and a large number of program samples of all kind. As with the other BASIC flavors, that I tried out (except for FreeBASIC), I did not spend a lot of time with the product. Just built and ran some of the included samples. They all worked perfectly, on my Windows 10 Potato, as well as on my standard Windows 10.

Configuration for a given project is done using the command Compiler > Compiler Options from the menu bar. On the Compile/Run Options tab, you can enable/disable the debugger, as well as set command line arguments for the executable to be built. Code interpretation/execution/compilation are done with the commands Compiler > Compile/Run, resp. Compiler > Run resp. Compiler > Create executable

You can use PureBasic to create GUI applications thanks to the IDE integrated form designer. I did not try out this feature...

PureBasic on Windows 10 - IDE with integrated form designer

The screenshot below shows the code of a simple GUI application sample with inline assembly, opened in the PureBasic IDE, and the execution of the application from within the IDE.

PureBasic on Windows 10 - Simple GUI application sample with inline assembly

There is no doubt that PureBasic's strength lies in graphics, both 2D and 3D, thus is a BASIC development environment that game programmers should give a try. The screenshot below shows a simple 2D drawing sample.

PureBasic on Windows 10 - Simple 2D drawing application sample

And here is the screenshot of a PureBasic 3D animation sample. Just a simple demo, but letting you imagine the power of graphics programming with a minimum of code and effort, that offers PureBasic.

PureBasic on Windows 10 - Simple 3D animation demo sample

thinBasic.

"Very fast 'BASIC like' programming language useful to beginners and to gurus. BASIC interpreter for Windows able to create console and Windows GUI applications with most of the user interface controls, automate process, automate data exchange, connect to databases, send mails, connect to ftp sites, call remote API, parsing strings, tokenizer, JSON, XML, text and binary files, CSV, INI, Registry, WMI, serial ports, OpenGL, graphics, sound, printing, COM automation and objects ... and much much more ... since 2004!", the product is described on the thinBasic website.

As FreeBASIC, thinBasic is freeware, as a difference with FreeBASIC and PureBasic, it is available for MS Windows, only. A complete development environment, including lots of features, that should give the BASIC developer the means to create "any applications they want".

One bizarre thing about thinBasic: It does not include a compiler. Instead, there is an application called thinBundle, a pseudo-compiler, so to say, in fact, a thinBasic tool and module, able to create stand alone executables scripts. thinBundle will create a kind of closed, compressed, crypted executable file containing all the resources a script needs in order to be executed without having thinBasic installed on the target machine. The .exexe file produced, will be like a box containing all the files needed to execute the script (DLL, modules, sources, thinBasic executable, ...). When an executable file created by thinBundle will be executed, a special minimal runtime starts. This runtime will extract on disk all files included in the bundled executable. All files extracted will have the hidden attribute set. Runtime will than execute the main script. After execution, all extracted files will be deleted.

To download the Windows installer, please, visit the thinBasic website.

The thinBasic installation files include an IDE, called thinAir. Beside an editor, with syntax highlighting and checking, a system resources monitor (showing CPU, GPU and memory usage when running a thinBasic program from within the IDE), there also are a Visual Designer (screenshot on the left), and a Resource Editor (screenshot on the right). I did not try out these features.

thinBasic on Windows 10 - Visual Designer
thinBasic on Windows 10 - Resource Editor

The screenshot below shows the execution of a command line sample, opening a GUI-like message box. The program has been started from within the IDE, and in the background, you can see the output produced by the system resources monitor.

thinBasic on Windows 10 - Command line sample

Here is a screenshot of a classic Windows GUI application created with thinBasic.

thinBasic on Windows 10 - Desktop (Windows GUI) application

As thinBasic is a "BASIC-like" language, former QuickBASIC users would probably not opt for it; neither probably wouldn't those, who care about cross-platform development. thinBasic seems really nice, powerful, and including a huge number of features. However, my experience with it is rather bad.

As shows the screenshot below, there are samples included, that, when trying to run them, abort with a runtime error. This should not be the case with code officially distributed with development software!

thinBasic on Windows 10 - Runtime error with one of the installation files included samples

As I said above, thinBasic doesn't include a compiler, but instead uses the "pseudo-compiler" thinBundle. The screenshot shows the creation of a bundled executable using this tool.

thinBasic on Windows 10 - Creating a bundled executable using thinBundle

Unfortunately, thinBundle seems to have serious issues, or at least does not work out of the box. All the bundled executables, that I created, aborted with the runtime error Obfuscated script not valid (error code 12000).

thinBasic on Windows 10 - Bundled executable abortion with runtime error 'Obfuscated script not valid'

Here again, my opinion is that these problems should not happen! I did not try to resolve the issue (that I found already mentioned in a post from 27.10.2007!?).

Oxygen Basic.

"Oxygen Basic is a compact embeddable Just-In-Time (JIT) compiler that reads C headers and compiles to x86 binary. It executes directly in memory or creates DLLs and EXE files (both 32- and 64-bit). It supports overloading and OOP and is currently available for Microsoft platforms.", they write on the product website. Oxygen Basic supports C headers, assembly code, and Unicode source scripts. The download archive contains the filesystem structure (just copy the whole to some directory as, for example, C:\Programs\OxygenBasic). The installation includes an IDE, called Oxyde. It also includes all features necessary to create WinAPI and OpenGL based applications. On the other side, the Oxygen Basic development environment does not include a RAD tool, i.e. there is no visual designer (to create GUI applications by drag-and-drop of visual components).

As FreeBASIC, Oxygen BASIC is freeware, as a difference with FreeBASIC and PureBasic, and identically to thinBasic it is available for MS Windows, only. I downloaded Oxygen Basic from Sourceforge. Help documentation is accessible from within the IDE. For the rest, there are very few Oxygen Basic resources available on the Internet. One website that you might want to visit is the Oxygen Basic Forum. To note, that I myself did not succeed to compile the program samples that I downloaded from the forum website. I suppose that they have been written for an old version of Oxygen Basic, and that that code doesn't work anymore on the actual version (?).

The screenshot below shows a sample using the WinAPI to create a simple Windows GUI "Hello World" application.

Oxygen Basic on Windows 10 - Simple 'Hello World' GUI application

And here are the screenshots of two animated graphics applications: On the left, a rotating cube; on the right, a simple Pong game.

Oxygen Basic on Windows 10 - Rotating cube application
Oxygen Basic on Windows 10 - Simple Pong game application

Note: thinBasic includes an Oxygen module, that makes it possible to include Oxygen Basic code into thinBasic sources. Examples are provided among the installation files included samples. A nice example is the physics simulation "Collision of spheres", shown on the screenshot below.

thinBasic on Windows 10 - Example of Oxygene Basic code included in a thinBasic source: Spheres collision

Conclusion? As a difference with thinBasic, all included samples seem to compile correctly and the executables produced run without problems on another Windows computer. Being shipped without a visual designer, Oxygen Basic is obviously not the ideal software to create GUI applications. The lack of manuals, tutorials and websites with working application samples may also be a reason for many BASIC programmers to opt for one of the other development environments available.

Small Basic.

"Small Basic is the only programming language created specially to help students transition from block-based coding to text-based coding. By teaching the fundamental elements of syntax-based languages in an approachable manner, Small Basic gives students the skills and confidence to tackle more complex programming languages such as Java and C#. You can also build applications for Kinect, Lego Mindstorm, Raspberry Pi, Arduino, Oculus Rift, and more using Small Basic. For ages 7 to 107, Small Basic is one of the easiest ways to learn to code.", they write on the Small Basic website.

The idea behind Microsoft Small Basic is rather refreshing:

You can download Small Basic (free of charge, of course) from the Small Basic website. You might also want to search the Internet for the PDF version of Microsoft Small Basic – An introduction to Programming.

The application download is a typical Windows installer program. Just run it, and start the included IDE from the Start menu.

The Small Basic IDE is kept extremely simple: 13 icons distributed to 4 groups:

Small Basic on Windows 10 - The Small Basic IDE

The installation files include some Small Basic samples. When I tried to run them on my Windows 10 Potato, I got the error message Sorry, we found some errors. Access is denied. This is not a Small Basic problem, but due to the fact that Small Basic was installed to "C:\Program Files". This is a Windows system directory, and write-access is only permitted, when the program runs in "Administrator" mode. Thus, the executable cannot be created. Simple work-around: Copy the Small Basic samples to some read-write accessible directory (I use C:\Data\Programming\SmallBasic") before building them.

The screenshot below shows the successful execution of the sample Fractal.sb, launched from within the IDE (Run button).

Small Basic on Windows 10 - Compiling and running the sample application Fractal.sb

"Not everything that shines is gold", the proverb tells us. Trying the graduation of the Small Basic programs to Visual Basic projects, I failed. Error message: Object reference not set to an instance of an object. As I've no intention to use the graduation feature, I did not try to find out what this message means and how to solve the problem...

Another fact, that gives to think, is that the latest version of Small Basic has been released in 2017. Does this mean that Microsoft has abandoned the development? Also note, that none of the actual web browsers supports the Silverlight extension anymore. You could use it running an old portable version of Firefox, for example, but be aware that Silverlight has always be a highly vulnerable application.

You can find the published Small Basic programs at the Small Basic Program Gallery website. Please, note, that some of them may contain errors and thus do not compile without modification!

The screenshots below show two of the applications that I tried out successfully. The first one is called Tetris (written by Kenneth Kasajian), the second one is called Christmas Trees with Snow (written by NaochanON).

Small Basic on Windows 10 - Running a program published at the Small Basic Program Gallery: Tetris
Small Basic on Windows 10 - Running a program published at the Small Basic Program Gallery: Christmas Trees with Snow

Have you noticed that on the second screenshot, the color of the window title bar is blue (and not red as on the other screenshots)? In fact, this screenshot has been taken on my standard Windows 10. This shows that it is possible to run Small Basic programs, developed on one machine, on another computer. What is needed to do so? When you push the Run button in the Small Basic IDE, there are several files that are created (therefore, you should place each of your Small Basic source files into its own directory), among them the executable and a DLL called SmallBasicLibrary.dll. To run Small Basic programs on a computer, where Small Basic actually isn't installed, this DLL is required and must be found by Windows. Either place it in the same directory as the executable, or place it into C:\Windows\System32.

QB64.

"QB64 is a modern extended BASIC programming language that retains QBasic/QuickBASIC 4.5 compatibility and compiles native binaries for Windows, Linux, and macOS.", they write on the QB64 website. If this compatibility is reality, this would mean that we could run the old QBasic/QuickBASIC programs (the one that we wrote when we were young, as well as the 1000s published in computer magazines) on the latest releases of Windows (as well as on macOS and Linux) without the need of virtualization software! This may be the BASIC development environment for "DOS-time" nostalgics (who want to work on Windows)... Not only, however. QB64 includes modern extensions, such as OpenGL, and thanks to InForm, a Rapid Application Development (RAD) tool for QB64, you can create event-driven GUI applications.

There are several forks of QB64 available, in particular QB64, that I actually tried out, and that you can download (all QB64 software is freeware) from QB64.com, and QB64PE, also called the "Phoenix Edition". This latter one is lots more active than the distribution at QB64.com, but when I unpacked the download archive, my Avast Free Antivirus, reported a Trojan Horse in the file "gcov.exe"! This might be a false positive, but Trojan horses are lots to dangerous to ignore warnings about them, in particular if there is an alternative to the concerned software, in this case QB64 from the QB64.com site.

I unpacked the download archive to C:\Programs\qb64, and created a launcher for qb64.exe in the Windows Start menu. The program qb64.exe is actually an IDE for QB64; it is fully intentional that it looks like similar software looked like in "old DOS days".

QB64 on Windows 10 - The (DOS-software-like) QB64 IDE

Concerning the "flagged by antivirus software", I would say the following: Software that is not digitally signed to be usable on Windows 10/11 may probably be flagged by some antivirus, but I don't think that they would call it infected with malware in this case. So, if you should get a warning about malware, do not install the software; otherwise there shouldn't be a problem. I actually tried out QB64 2.1, 64-bit, and my antivirus neither flagged QB64, nor the executables created. Thus, in case of problems, maybe the solution will be to search for this version...

It seems that the installation files don't include program samples. You can find QB64 sources by searching the Internet. In particular, there are lots of nice game samples available at the QB64 Tutorial website. You'll also find there lots of InFormation about programming in QB64 (actually QB64PE), the usage of the InForm IDE, etc.

One of the programs, that I found there, is hangman.bas, a simple text-based hangman game. You can compile and run it using the command Run > Start from the menu bar; to only create an executable (without running it), choose Run > Make EXE Only. In either case, you should check the option Run > Output EXE to Source Folder; otherwise, the executable will be saved into the QB64 folder.

QB64 on Windows 10 - Compiling and running a QB64 program

The screenshot below shows the execution of hangman.exe.

QB64 on Windows 10 - Simple text-based hangman game

Two further game samples on the screenshots below. The screenshot on the left shows the execution of "Slot Machine Poker", the screenshot on the right, the execution of "Battleships".

QB64 on Windows 10 - Execution of the game 'Slot Machine Poker'
QB64 on Windows 10 - Execution of the game 'Battleships'

The RAD tool InForm can be downloaded from github. The download contains the application filesystem, that I unpacked to C:\Programs\InForm. I then created a launcher for UIEditor.exe in the QB64 folder of Windows Start menu. The application is a visual designer, that allows you to place components onto a form by drag-and-drop, configure them by editing their properties and associate events with them (such as: execute a given procedure when the user clicks onto the component). The application only includes the basic components, but this should be enough to create most GUI applications. I actually did not try it out; for details about how to use it, have a look at the documentation.

QB64 on Windows 10 - InForm: A RAD tool for QB64

There are several people in the QB64 community with projects that serve to compliment QB64; extending the reach and capability of the QB64 developer. InForm is one example of these additional/complementary tools. Other examples are GX, a game engine for QB64 that also allows you to extend your reach to the web, and QBjs, an implementation of the BASIC programming language for the web, with multimedia support and easy sharing of programs that aims compatibility with QBasic, QB4.5 and QB64 (I didn't try out either of them). There are several others; have a look at QB64.com for details.

GFA-BASIC 32.

"GFA-BASIC is a dialect of the BASIC programming language, by Frank Ostrowski. The name is derived from the company ("GFA Systemtechnik GmbH"), which distributed the software. In the mid-1980s to the 1990s it enjoyed popularity as an advanced BASIC dialect, but has been mostly superseded by several other programming languages.", you can read in Wikipedia. GFA-BASIC has a long history. The first version was released in 1985 for the Atari ST, followed by a version for the Amiga. Then GFA-BASIC was developed for the Intel processors: GFA-BASIC for MS-DOS, GFA-BASIC for Windows 3.1, and GFA-BASIC 32 for Windows 95 and later; the actual version 2.62 (from February 2023) requires Windows Vista or higher.

The software is shipped with an extendable IDE, from where you can build and run your GFA-BASIC programs. Interesting, that the old 16-bit sources are automatically converted to the new 32-bit syntax. The language supports lots of data types, including 64-bit integers, date, pointer, variant, object, enum, array, hash and collection. GFA-BASIC 32 supports more than 1000 WinAPI-Functions, functions that can be used as any other GFA-BASIC 32 function Only the Standard-API-Functions from User, Kernel and GDI are implemented, other not often used API-Functions like for instance WinSock-Functions are to be declared explicitly as in VB. As with the built-in API functions from User, Kernel and GDI, their accompanying constants are built-in. (1400 API-Constants from the 16 Bit-Version and more then 900 Constants from Win32-APIs are implemented). CreateObject creates and returns a reference to an ActiveX object. After the object reference is assigned to a variable of type Object you can use the object's properties, methods, and events. There are several rather special objects, like for example App, Screen, Printer, Err, Picture and Font. It also supports inline assembly and includes a disassembler object. For further details, please, have a look at the GFA-BASIC 32 website.

You can download the software from the website mentioned above. The download archive contains a Windows installer. Installation (in my case on Windows 10 Potato) is straight forward; just accept all defaults. Note that GFA-BASIC comes with a CHM help file, that may be accessed from within the IDE. It also includes a great number of program sources, mostly small samples to show how to proceed to perform a given task, or to use a given component. It seems, however, that not all of these samples have been thoroughly tested, as shows the screenshot of the system information sample below; I suppose that the program uses integers that are not wide enough to hold gigabyte memory sizes.

GFA-BASIC 32 on Windows 10 - System information sample showing negative memory sizes

Other samples, like D2PlotSin just produce an empty window. These are things that, by my opinion, must not happen with example programs included with development software.

A nice 3D graphics demo is 3dsin (screenshot). On the other hand, the execution of 3dsin2 makes GFA-BASIC hang and I had to use Windows Task Manager to kill the IDE.

GFA-BASIC 32 on Windows 10 - Nice 3D graphics sample included with the installation files

Note: When compiling the included sample programs, and trying to save the executable, I got the message You don't have the permission to save in this location. This is due to the fact that the samples are in some subdirectory of "C:\Program Files (x86)". I'm not sure if the Windows system directories are protected by default, or if I made such setting. Anyway, just choose another save location.

The executables produced may not necessarily be simply run from the filesystem or on another computer. In fact, you may get the error message The code execution cannot proceed because GfaWin32.Ocx was not found. To resolve this issue, just copy the ActiveX control file (located in the "bin" folder of the GFA-BASIC installation directory) to the directory that contains the executable.

GFA-BASIC has without any doubt a lot of potential. However, it seems that there is no possibility to create forms by simple drag-and-drop. This will probably be a reason for most programmers, who want to create GUI desktop applications, to use Visual Basic, or choose one of the other BASIC distributions discussed in this article.


If you find this text helpful, please, support me and this website by signing my guestbook.