At last, the BASIC you've been waiting for
GFA BASIC is a powerful and extremely fast structured language recently brought to the U.S. from Germany. It includes a good editor, a run-time package, and quite a bit of GEM support. It has a surprisingly small number of bugs, but the current manual is poor, although MichTron is rectifying this. At the moment, however, GFA BASIC is well worth a look, so let's examine its features more closely.
USING GFA BASIC
Upon first booting GFA BASIC, you are in a full-featured text editor. Instead of drop-down menus, the screen features a double line of commands at the top. You may point to, and activate, these commands with the mouse. Most of the commands also have keyboard equivalents, so you need not use the mouse if you don't want to. These commands include such useful items as LOAD, SAVE, FIND, REPLACE, Block Operations (Copy, Move, Print, Save, Hide and Delete), LLIST (printed listing), FLIP (to output screen), DIRECT (immediate mode, where commands are executed immediately), TEST (checks loop construction) and RUN. A full range of cursor movement commands are also available through various keystroke combinations. These commands make navigating through the text editor quite simple. The full screen is available for text entry.
GFA BASIC does not use line numbers. Instead, references to a specific place in the program, such as for GOTO or RESTORE, is by label. Each line of text is checked for syntax as it is entered. If there are no syntax errors, the line is accepted, and all commands are automatically capitalized. Any commands which were entered in their abbreviated form are also written out at this point. Lines of text may be up to 255 characters in length, although only one command may be on each line. Lines of text which fall within loops (DO/LOOP, WHILE, IF/THEN or REPEAT/UNTIL) or PROCEDUREs are indented to make identifying the loops and PROCEDUREs easier. The TEST command will check to make sure that loops are properly set up.
GFA BASIC maintains two independent screens. The first is the text screen mentioned above. The other is the output screen where all your program output is displayed. You may manually FLIP between the screens if you wish. The DIRECT command returns you to the output screen with a cursor for your input. The RUN command also automatically flips to the output screen. This two-screen system solves the dilemma of edit and output windows rather nicely. The people who are rewriting ST BASIC should examine this latter GFA feature closely.
FEATURES OF GFA BASIC
The language includes all "normal" features you would expect from BASIC, as well as some more advanced commands. The DO/LOOP construction executes a series of commands until the EXIT IF condition is satisfied. There are also REPEAT/UNTIL and WHILE/WEND loops. The TIMER command allows access to the system timer, which measures the time since the system was turned on in increments of 1/200 of a second. TIME$ and DATE$ allow reading and setting the time and date. It provides full file access for both sequential and random access, and you can directly address system peripherals and ports. You may define your own one-line functions using the DEFFN command. Also supported are PRINT USING for formatted output of numbers and strings, and PRINT AT for locating output on the screen. GFA BASIC also includes commands for sound, manipulation of files and directories (Folders), Trace debugging, and some math functions (such as ADD) which are much faster than the (also supported) operators +, -, etc. The EXEC command loads and executes machine code programs. Memory can be protected for use with this command. You can even use C-type pointers to indirectly access variables.
As I mentioned earlier, GFA BASIC is a structured language. It supports PROCEDUREs, which are similar to subroutines and are called using the GOSUB command. However, you can pass variables to the PROCEDURE, and also make use of LOCAL variables. Thus, a variable declared LOCAL to the PROCEDURE may have the same name as a variable in the main program, but altering the value of one does not affect the other. Variables passed to a PROCEDURE are automatically LOCAL, and, unlike Pascal, there is no way to pass an altered value of a LOCAL variable back to the main program except by using indirect access. All PROCEDUREs must be located at the end of the main program, although their order doesn't matter. PROCEDUREs can call other PROCEDUREs (even those ahead of them in the listing) and can even call themselves (recursion).
GFA BASIC does a pretty good job of supporting GEM. Keywords include a variety of shapes such as ellipses, rectangles, lines and markers. There are even commands for polygons. You can easily define colors, marker shapes, line types and fills, including user-defined patterns. The TEXT command allows you to put text on the screen using any of the specified attributes, such as underlined, italics or outlined. You can also specify text size and orientation of the letters.
The position of the mouse and status of the mouse buttons is available. You can change the shape of the mouse to one of the predefined shapes or use one of your own design. Included on the GFA disk is a program to help design your own mouse shape, and you can also hide or show the mouse cursor.
In addition, you can build your own menus and install them. There is a command to add or delete checkmarks or disable and enable menu items. Commands are also provided to detect what menu item has been selected, when the mouse has entered or left one of two definable rectangles, when a keyboard key has been pressed, when a mouse button has been clicked, and when a message has been received from GEM. These messages are typically related to windows, and occur when the user clicks on the "close box" or a slider, for example. These messages are accessible to you in a message buffer. While powerful, many people will not be able to implement these commands in their own programs because the current documentation doesn't give enough information on how to do so.
GFA BASIC does support windows, allowing to open and close them, full them, clear them, and set the title and information line. The windowing is a little strange, however. You are allowed to open up to four windows, with each window in a different quadrant of the screen. For example, window 2 is in the upper right corner. Specifying x and y when you open window 2 will set the LOWER LEFT corner (and thus the window size); the upper right corner of the window always coincides with the upper right corner of the screen. Window 3, on the other hand, is in the lower left portion of the screen. For window 3, x and y specify the UPPER RIGHT corner of the window. This is confusing. A table of information about the windows (coordinates, attributes, etc.) is available, although once again poor documentation makes it difficult to use.
GFA does a good job of bit-blitting (moving blocks of bits around the screen, usually for animation), with both built-in commands and GEM's Bitblt. Functions for saving areas of memory to disk and moving memory around fast are provided, and alert boxes are also easy to use.
Beyond the directly-supported commands, GFA BASIC allows you to access VDI and AES by numerical calls, just like ST BASIC. However, all the system variables required, such as GINTOUT, ADDRIN, INTIN and the rest are already predefined to make your job a little easier. You may gain access to XBIOS and BIOS calls in a similar manner.
DOCUMENTATION AND SUPPORT
My review copy of GFA BASIC included an early copy of the manual. It was laced with typographical errors, and certain sections were translated from the original German in an incomprehensible manner. In certain cases the language was also much too technical (folders were referred to as "hierarchical file system"). The organization of the manual left a lot to be desired, since basic information such as variable types was left to the appendices at the end, while other subjects, like arrays, were never mentioned at all.
Phone support from MichTron is quite good, considering how new this product is. At this writing, support is still in the "check it and get back to you" stage, but that will have changed by the time you read this. I did run across a few minor bugs-for example, the PRINT USING command does not work properly in exponential (scientific) notation. This should be corrected.
GFA BASIC is a powerful language. With a good manual, it would also be easy to use. The number of commands and GEM support is not as extensive as FAST ST BASIC from Computer Concepts (see my review, in last issue's ST Resource), but it is also not as crash-prone, and MichTron's support and the availability of a run-time package are admirable. MichTron also says a compiler to produce stand-alone applications should be available before you read this. With the new, rewritten manual, this should be a good language for most ST owners who need only the built-in commands. As with ST BASIC, though, the extra GEM support available only "by the numbers" is best left to experienced programmers-unless you're feeling adventurous.
576 South Telegraph
Pontiac, MI 48053
CIRCLE 228 ON READER SERVICE CARD