QBasic can read and run plain text program files (.txt, otherwise known as ASCII), but it can't read nor run files saved in GWBASIC's native binary code format. So, if a program was written using the older GWBASIC interpreter and then it was saved as a binary file, and then it is run on the newer Qbasic interpreter, it will not work. You can check to see if a BASIC program file needs to be converted to ASCII by double-clicking on the file to open it (do this in Windows). If all you see is jibberish on the screen, then you will have to convert the file into a text format. This is easily done.
Do the following (you must load and run the GWBASIC interpreter for this to work):
1) To convert a binary GWBASIC program into an ASCII text file while running GWBASIC, type the following command at the "OK" prompt:
Be sure to put quotes around the file's name.
(Since I already have posted my programs in ASCII, you can skip this step. Proceed to step #2).
2) Exit the GWBASIC program (type "system" at the "OK" prompt). If all went well, your GWBASIC program binary file should now be in ASCII (text) format. To confirm this, double click to open the file and see if you can read its contents. If all that you see is jibberish, then the file is still in its native GWBASIC format. Go back and repeat step #1.
However, if you see legible (readable) sentences, then the conversion was successful. Next, cut and paste your ASCII file into the same directory/folder where the program Qbasic.exe resides.
3) If your program file's extension ends in .txt (all of the BASIC program files that I posted on the Web have the .txt) extension), then be sure to rename the file with a .bas extension. The program will not run if it doesn't have the .bas extension after its file name.
4) In most cases, all you have to do is load Qbasic (it can be loaded either from the MSDOS prompt or from a Windows shortcut icon) and then load the ASCII file from within Qbasic. To do this, click on FILES/OPEN, and then click on the file's name. Lastly, click on "ok").
If everything went as planned, you should see your program's code appear in the Qbasic window. Skip step #5 and proceed to step #6. But if nothing appears in the window, then Qbasic didn't recognize your file. To fix this problem, exit Qbasic and proceed to step #5.
5) Reboot the computer in MSDOS mode (NOT Windows) and go to the directory/folder where Qbasic.exe resides. Load Qbasic.exe manually (i.e., via the keyboard) by typing the following at the MSDOS prompt:
6) While in Qbasic, click on (FILES/OPEN) to load your program as in step #4. Click on the file name, and then click on the "OK" button.
7) To run the program, click on RUN/START on the QBasic menu bar.
8) Before you EXIT the program, be sure to SAVE the program to preserve its new file format.
If everything went well, then you won't have to do this again (at least not with that particular BASIC file).
Go back to previous page