Categories
Last century it wasn’t always that easy to get some BASIC programs to work on the ‘new’ IBM PC. A lot of the programs were written in some weird dialect of BASIC. Some were hardware and graphic specific…
Now you can use FreeBASIC on all three common platforms and even the Raspberry Pi. So if BASIC is your ‘thing’, you can revive some programs that you thought were no longer to be useful.
I have just taken an hour or so to re-process a program for a band pass filter. It now works 100% under Linux and compiles with FBC.
As I completed it and proved it, I thought I should share the methodology with people in similar situations. It is not difficult to use the standard applications such as FreeBASIC and Geany. But I had to go back in my DOS applications to find a way of compiling the program without thousands of errors.
If I used Quick BASIC, there was no ‘issue’ in running the program. But when I tried to compile it using ‘fbc -lang qb bpfs.bas’, it spat at me errors that went off the screen!
Most of the errors were that most of the variables were not declared or DIMensioned. The spell checker doesn’t like that. But it means the arrays need to have a DIM statement prior to use. Hmm, how do you fix this?
Visual BASIC had an OPTION EXPLICIT that you could put at the beginning of the program. So that you would be reminded every time you tried to use a variable. VB doesn’t work under Linux… But how about VB for DOS? Yes it does work in DOSbox and Visual Basic does have the OPTION EXPLICIT statement. So I added the source file to a new project in VBDOS and inserted an OPTION EXPLICIT up top that stopped running or compiling where a variable had not been declared. Note all the variables and declare them at the beginning of the program. Then run and compile. If it compiles 100%, then you know it will compile with FBC.
Just one thing that might trip you up. In GWBASIC and QBASIC, if you use a variable anywhere in the program, it defaults to type SINGLE. If you use the ‘$’ in the program for STRING, you must declare it without the dollar sign ‘AS STRING’. Oh and don’t forget – if the filename is in capitals, you must type it in capitals after fbc -lang qb FILENAME.BAS…
Both DOSbox and FreeBASIC will work on a Windwoes, MAC or Linux PC. Both are free downloads. And your programs will end up working on all three systems.