Using the Blitz Preprocessor

Basic-style programming languages lack features that more advanced programmers tend to take for granted. Type checking and explicit variable declarations are two examples. We have spent many hours debugging code only to find that an error was caused by a simple spelling error. This is highly inefficient.

The simplest way to get around such inefficiencies is to use the Unofficial BlitzBasic Preprocessor. A link to the Preprocessor's website is available on the links page. The Preprocessor allows us to eliminate simple bugs easily. It also has abilities similar to C's #ifndef. We made use of a couple of features of the Preprocessor. Other features, such as preprocessor macros and type/stream commands, are available but were not utilized in our program. Installation of the Preprocessor is extremely simple, as long as the instructions provided on the website are followed to the letter. Here are the features we used in our source code:

Profiling
This can be enabled by including the #Profile directive at the top of the main source code file. It generates a list of all user-defined functions and the number of times they are called in a nice, easy-to-read HTML table.

Explicit Variable Declarations
The #Option Explicit directive enables this feature. It checks to see if a variable is explicitly declared as a Global or Local variable before it is used.

C-Style Defines
Uses the #Define, #IfNDef, #IfDef, and #EndIf directives. This is what allowed us to simplify the concurrent development of C-Wall and PC versions of BreakoutVR. A single #Define was placed at the beginning of the C-Wall tracking code to signify that it is enabled. All code that uses tracking is wrapped in #IfDef/#EndIf directives, while all PC-based code is in #IfNDef/#EndIf directives. This made concurrent development as simple as commenting or uncommenting a single line, depending on which version was to be compiled.