Classic Computer Magazine Archive COMPUTE! ISSUE 80 / JANUARY 1987 / PAGE 90

IBM Personal Computing

Donald B. Trivette


QuickBASIC


If you like the IBM BASIC language, you're going to love Microsoft's new QuickBASIC Compiler. That is, once you get used to it. In the beginning, some IBM BASIC programmers may well find QB cumbersome and something of a bother to use.
    The first bump in the road is QuickBASIC's full-screen editor. Instead of typing line number 11 to insert something between lines 10 and 20, as you would in IBM BASIC, you have to move the cursor to the end of line 10 and then press the enter key. A space opens on the screen to allow statement 11 to be added in its proper place. This would be easy enough if only I could remember to put the cursor at the end of the'previous line before pressing the enter key.
    The next takes-getting-used-to item is deleting a line or parts of a line. QuickBASIC hasn't heard of CTRL-Backspace, instead it uses CTRL-D to delete everything to the right of the cursor, and CTRL-Y to delete a whole line. (Who can remember CTRL-Y?) On the other hand, I don't have type LIST 850-950 to look at a portion of my program; pressing the PgUp or PgDn keys instantly displays screens full of the program, and that's a nice feature.

Menu Troubles
While LIST and DELETE have their QuickBASIC counterparts in special keys, most of the IBM BASIC commands don't (for those QB uses menus). There are five menus: File, Edit, View, Search, and Run; and each menu has what Microsoft calls dialog boxes-which are really lists of commands. Want to save a program? You must press the ALT-F to drop down the files menu, select the SAVE command with the cursor keys, approve a file name from a dialog box, and finally press Enter. I could type SAVE "ABC" a dozen times by the time I go through all that, but you can't stand in the way of progress.
    To make up for these annoyances, the QuickBASIC editor has some nice features that IBM BASIC doesn't. Want to move a whole block of statements from the top of the program to the end? just call up the Edit menu and use the Cut/ Copy/Paste commands. Need to change every occurrence of the variable INCOME to GROSS? Use the Change command on the Search menu. QuickBASIC supports a mouse for moving around the screen and selecting commands, and if I had one, menu-driven editing might make more sense-and be more fun.

Some Excellent Features
Fortunately, there's a lot more to QB than the editor. Since there's no need for BASIC to distinguish between commands and program statements, line numbers are optional. Instead of saying GOTO 60, you can say GOTO TOWN where TOWN replaces the line number 60 (i.e., TOWN: PRINT VALUE). QB also allows you to use real subprograms, called by a name, from which values may be passed back to a main program.
    Best of all, QB supports structured logic statements. For those of you who have never used a structured language like PL/1 or Pascal, that means you can control as many statements as you want with an IF statement. For example the following is valid in QuickBASIC.

IF TIME1>10 THEN
A=5
B=10
C=20
...
ELSE
A=33.3
B=165.23
C=66
...
END IF

    It's possible, as any computer science student will tell you, to write entire programs without ever using a GOTO statement. That may be carrying structured programming too far, but the structured IF is a much-needed addition to BASIC.
    There are features for the advanced programmer too: separate compilation of modules, each up to 64K, and the ability to store modules in a library and link them together into programs; the ability to directly call assembly language routines; and support for IBM's Enhanced Graphics Adapter (EGA).
    Compiler is a misnomer for QuickBASIC; it's really a complete BASIC language development sys tem. You can write the program using the full-screen editor, test it using the compile and run command (from a menu of course), which is the equivalent of IBM BASIC's RUN, fix any errors, and then compile, link, and generate an executable program (.EXE). All that under the QB umbrella.
    Or, if you dislike learning the new editing commands and using the pull-down menus, you may use the compiler functions of QuickBASIC in batch mode. Build the program using IBM BASIC-but no structured programming or other advanced features allowed-and then invoke the QuickBASIC compiler by command. The compiler switches are identical to the ones in the IBM COMPILER-for example, QB TEST /x/o/e; would compile the program named TEST. The truth is, the more I use QB, the less I return to IBM BASIC to fix errors and make small changes; eventually CTRL-D will become second nature and IBM BASIC will become a relic.
    BASIC programs compiled by QB will execute on computers running either IBM DOS or Microsoft's version of DOS. And at just $99, QuickBASIC is a steal.