Chapter 11. Converting Legacy Superbase
Where to Begin?
Explaining how to convert from a product that is as multi-faceted as the legacy Superbase product is not an easy task. The number of different ways that people have used the product means that any detailed set of instructions will be certain to fail the needs of a large percentage of those interested. Instead, this chapter will discuss some guidelines and techniques for conversion.
It is probably easiest to start with what things can be converted fairly easily. That list is as follows:
Database files (assuming they are not encrypted)
Display forms (currently
DisplayTextBox
objects are not supported – rotated editable text boxes)Print forms (these are the same forms in legacy Superbase, but are primarily meant to be printed and are handled separately in Superbase NG)
Dialog definitions (the
DialogFrame
object is not currently supported)Menu programs (as saved from the Superbase Menu Editor)
Graphic Reports (some hand-tweaking may be required in the resulting XML)
What is noticeably lacking from all of the above is any mention of program code. Legacy Superbase supports three distinct styles of BASIC programming:
Early QuickBasic with only global variables, and GOTO, GOSUB, and RETURN, with both line numbers and symbolic label names.
Procedural BASIC with SUB main() local and global variables, user-defined functions, and an event handling mechanism for creating event-driven programs.
Object BASIC with supplied objects for the GUI components, like forms, and form controls, dialogs and dialog controls.
That list mirrors a clear progression in the development of programming languages over the course of time. The problem is, legacy Superbase allowed the use of these different styles of programming concurrently. That isn't so bad for the final two, since the object BASIC is layered over the top of the procedural BASIC anyway. The problem is the original BASIC, and the excessive use of the GOTO and global variables.
There is nothing inherently wrong with the GOTO command (although some might argue very strongly about that), if it is used carefully (and sparingly) in the hands of a skilled programmer, but unfortunately it changes the direction of program execution permanently, and often cannot easily be followed by someone (or a program) reading the source code. Often the original author of the code will no longer understand how it works within even a few months of having written it.
Needless to say, if the original author no longer understands how their program works, the likelihood of any program understanding it, even one that is designed to convert source code, is very low. Having said that, it is not as bad as it sounds. Please read on.