Classic Computer Magazine Archive START VOL. 3 NO. 8 / MARCH 1989



GFA BASIC Programmer's Reference Guide,
Concepts in Programming, Programming with GFA BASIC 3.0

reviewed by David Plotkin,
START Contributing Editor

GFA BASIC is a powerful programming language, but its manuals have not always been everything they should have been. MichTron has followed GFA BASIC with the publication of several additional volumes. Below, however, I've reviewed books, which are a marked improvement upon the manuals. (Editors note: David Plotkin reviewed GFA BASIC 3.0 in the January 1989 issue of START.)

GFA BASIC Programmer's
Reference Guide, Volume I

by George W. Miller
484 pages (plus appendices), $29.95 softcover

The GFA BASIC Programmers Reference Guide Volume I is a large book that provides a wealth of information about GFA BASIC, easily the most widespread "user's" language for the ST. While this book doesn't contain much new information, it's well organized, very well written and sheds some light on otherwise poorly covered topics.

The first chapter covers the GFA editor in detail. It duplicates the information in the manual in large part here but is easier to follow and arranged better. This chapter also contains hints and tips about using the editor that are not in the manual.

The second chapter lasts for about 250 pages, documenting every GFA BASIC command. Again, it's largely a restatement of what's in the manual, but its written better. Unlike the manual, the commands are arranged alphabetically, making it easier to locate the information on a particular command. The programming examples all work except for a few well-documented cases, and related keywords are listed so that you can refer to them for more information.

Chapters 3, 4 and 5 take you through all the steps needed to construct eye catching demos and even games. Graphics, animation and sound are explored in detail, as are saving screens to disk, page flipping, GET and PUT animation, the sound and WAVE commands and sprites. Many sample programs are included, such as a kaleidoscope program and a complete shape editor and each section of code is explained clearly. In fact most of the book consists of commented programs. (I believe that the best way to learn how to program is by reading other peoples (commented) programs.)

Chapter 6 contains a complete telecommunications program. Not only is the code commented so that you can learn how to handle ports, baud rates, etc., but the program itself is very useful and worth more than the price of the book if you're a telecommunicator. You can customize the program completely, using the autodial directory, function key configuration and macro scripts! You can even run another program from within the telecommunications program using GFA's EXEC command.

The final sections of the book are the appendices that document calling BIOS, XBIOS and GEMDOS functions from within GFA. Each function has a paragraph telling what it does and a sample of how to call it. Since this is somewhat complicated, the examples are a big help.

I like the Programmer's Reference Guide. It's so well-written that even the minor typographical errors (which will be cleaned up in the second printing) don't detract from its overall quality. George Miller, MichTron's director of product support, obviously labored long and hard over it.

As a reference guide, it works well. It is important to note that intermediate to advanced programmers won't find a lot of new information here, and there really aren't any "how the heck did 'e do that" type of programming surprises in the book. What there is is a well-organized and useful reference work that will make using GFA BASIC easier to anyone and impart a lot of new information to beginners.

Concepts in Programming:
An Intermediate programmer's
tutorial for GFA BASIC 2.0 and

by Gotffried P. Engels
270 pages, $24.95 softcover

Concepts in Programming is a book which purports to cover GFA BASIC on an intermediate level. It contains quite a bit of useful information, however; much of the book is devoted to program listings and explanations of 3D graphics and a text editor.

The opening section of the book attempts to discuss the advantages of using structured programming methods. It succeeds fairly well, especially since the commands in GFA BASIC lend themselves toward structured programming. Such concepts as Procedures, Functions, DO WHILE, CASE etc. let you build your program in small, uncomplicated, testable sections. One problem is that the book shows several bad examples for solving a particular programming problem without demonstrating any good solutions! Overall, though, the diagramming techniques and example programs using GFA structured programming commands are good and illustrate the required points.

The first section also shows more efficient ways of handling memory moves and disk accesses. It also benchmarks various loop commands and details the structures of arrays. This really has nothing to do with structured programming, but it is interesting. Much of this section shows ways to get around the limitations of GFA BASIC 2.0 (no var passing to procedures, lack of a SORT command and no ELSEIF)--which are all fixed in GFA BASIC 3.0!

Section 2 introduces a 3D graphics program. It attempts (briefly) to discuss some of the mathematics, which are not trivial, but doesn't quite pull it off. Some short example programs follow, as well as a statement of the equations, commands and concepts used, followed by the details of the program itself. This program can show a wire-frame shape (with some hidden line removal) and lets you manipulate the shape (turning, moving, stretching) and even build a new shape. If you're interested in 3D programming, you'll find this section quite interesting. The methods used are discussed, but be warned that this program is quite complex. It covers everything, including loading and saving data, and even discusses some limited tricks to speed up operation.

Section 3, the text editor is over 100 pages long and presents a tool for editing text that includes scrolling with mouse and keyboard, inserting and deleting lines, and block operations. Once again, a limited number of tricks are presented for manipulating text quickly. Methods demonstrated include use of BMOVE, the VT-52 emulation commands, responding to menus and keypresses, and the advanced use of pointers to move text around the screen without actually moving it around in memory--which can be done very quickly. Much of what is covered here is interesting, but this section has two problems. First, quite a bit of the program is not discussed (due to space limitations), and even with what is discussed, the section is simply too long and the example program is too complex. By the time you've studied the entire listing in detail, through, you have forgotten much of what went on earlier in the program.

Concepts in Programming seems to be unsure about what audience to address. The first section can be of help to someone who is not too experienced, but the last two sections are likely to overwhelm anyone who is not an experienced programmer. Further, these two sections are of very narrow interest.

The book may be of some use to someone who would like to know some useful tricks. The value of the book is definitely the learning experience and not the programs included (the 3D graphics program is not a full-functioning utility and there are much better text editors). Much of the book is filled with complex listings that are hard to follow, and aren't very conducive to teaching programming concepts very well. There are many things that can help you program better and this book covers some of them, but in a format that makes it difficult to learn the material.

Programming with GFA BASIC 3.0

by Gotffried P Engles and Markus C. Gorgens
366 pages, $24.95 softcover
Program disk: $15.95

Programming with GFA BASIC 3.0 fills in the gaps in the user manual in a mostly clear; concise way, and should be on the bookshelf of anyone even remotely interested in using the advanced features of GFA BASIC 3.0. (Editors note: David Plotkin reviewed GFA BASIC 3.0 in the January 1989 issue of START.) In addition to its well-written text, Programming with GFA BASIC 3.0 has many example programs which are well-commented and very useful in understanding some of the programming techniques of this powerful language.

The first major section of the book deals with structured programming. One major improvement of 3.0 over 2.0 is the increased variety of loop, decision and Procedure/Function commands. Several illustrative examples show how the new loop and decision commands help you program more efficiently. This section also shows how the ability to pass variables to a Procedure as well as to multiline Functions, increases programming power. The sample program demonstrates these principles aptly with a mathematical function evaluator that you could use to create your own spreadsheet program.

Handling of variable types and sorting arrays is the subject of the next section. Not only does GFA BASIC 3.0 include two different types of sorts, but there's a variety of options in using the sort commands. Programming with GFA BASIC 3.0 explains these options and demonstrates how to use the sort commands to set up a database. Pointer commands are directly supported by 3.0, and these are also explained in this section. Pointer operators are very important to GEM, and having them available makes it easier to deal with Menus, windows, dialog boxes, etc.

Working with numbers in a bitwise manner is the subject of the next section. Although this section is not of much use to the average programmer, the information contained here allows for significant increases in execution speed.

The next subject is Line A calls, which not only give you more flexibility but are often much faster than the equivalent commands built into GFA BASIC 3.0. Examples of clipping, line drawing, pattern filling and point setting and testing are all demonstrated. Some explanations are convoluted, but experimentation should help clear things up. A large demo program shows how to implement two different kinds of splines (curves drawn between specified points).

Section 6 is about debugging your programs. Although the manual itself does a good job of explaining the debugging commands, this section is valuable because it includes a sample subroutine which can be accessed after every command. The subroutine simply returns to the main program unless a key has been pressed, at which time it gives a series of reports of variable values and other information. After the section on debugging there is a short section on using assembly language in your programs.

Section 8 is easily the most valuable part of the book and is worth the price all by itself. It is here that all the AES functions concerning dialog boxes are explained in great detail, with three example programs. GFA BASIC 3.0 supports AES functions in a much more straightforward fashion than earlier versions.

Further, the GFA BASIC 3.0 package includes a resource construction set, which makes it very easy to build dialog boxes. Not only does this part of Programming with GFA BASIC give hints on using the resource construction set, but it also provides complete examples on using all the different types of objects which can appear in a dialog box, including text, buttons, editable text, icons and sliders. The explanations are superb.

A useful utility included in this section is a program to create icons (for including in a dialog box) from DEGAS format graphics. These icons are then saved to disk as a resource and can be merged into a resource you're building with the resource construction set. This is the simplest way to include graphics in your dialog boxes.

You can also use a resource construction set to create pull-down menus. Of course, you can create menus within GFA itself (and it will be easier if you use the Menu-builder program published in the December 1988 issue of START), but if you do create menus with an RCS, they need to be managed differently by the application. The last part of this section shows how to do just that. It also shows how to have the menus appear in the middle of the screen or even pop up from the bottom of the screen. Unfortunately, these sample programs tend to lock up the computer.

A "resource analyzer" completes the section. This program can load a resource, let you work with it and save a GFA BASIC list file to disk that will load the resource and set necessary values. This program doesn't work very well, however. The screen layout is poor and buttons in the resource don't show up in the analyzed file.

The next section gives excellent examples of how to work with windows, including setting them up and responding to mouse-clicks. This section is especially valuable since it's much easier to work with windows in GFA BASIC 3.0 (due to the built-in AES functions) than in earlier versions.

The last section of the book shows how to use GDOS with GFA BASIC and includes a 3D function plotter that can output to your printer. Extensive appendices give detailed information on new or changed commands. Most errors in this book show up in the appendices, however.

Programming with GFA BASIC 3.0 is an extremely useful book. It clearly explains many of the aspects of this newest version of GFA BASIC that make it far easier to work with than earlier versions. It answers many of the questions raised by the (currently) poor manual and should be required reading for GFA programmers. It is well-written, carefully edited and highly recommended.

Contributing Editor David Plotkin is a chemical engineer for Chevron U.S.A. and a long-time contributor to START.


MichTron, 576 South Telegraph, Pontiac, MI 48053, (313) 334-5700.