Skip to main content

PREVIEW: GFA BASIC 3.0 by Richard Karsmakers

  If there is one program that a lot of people have been  waiting 
for, it must be "GfA Basic" version 3.0. What has changed in this 
powerful programming language? Has the speed increased even more? 
Have  all  the  bugs been  removed?  These  questions  should  be 
answered in this article.

The manual

 Quite on the contrary to the 'old' "GfA Basic" manual,  the  new 
manual  is about 450 pages thick,  and all commands  are  grouped 
into  clusters of those that have corresponding functions  rather 
than the alphabetic sequence in the 'old' manual.  Every  command 
gets   one  or  more  pages,   and  the  example   programs   are 
crisp'n'clear.
 And for those that are afraid the manual will not  suffice,  GfA 
Systemtechnik  has also written a book about "GfA  Basic  Version 
3.0" (in German),  that costs DM 59,-- (incl.  disk), whereas the 
German  company Heim Verlag also offers a book at the same  price 
(also including disk).

The editor

  The  editor  has  been  improved,  too.  At  first  sight,  one 
immediately notices the system time on the right hand top of  the 
screen,  below  which  the  current  line  number  is  constantly 
displayed.  It  is  now  also possible to start  execution  of  a 
program  from a specified program line.  Let's look at some  more 
features of the new "GfA Basic" editor:

              Defining macros is now also possible
    The numeric keypad can be used as IBM-style cursor keypad
  When going up and down a line, the cursor is not positioned at 
                 the start of the line each time
 Procedures can be reduced to just one line. This increases the
                 overall clearness of a program
          'Find' now displays the old 'find' criterium
 Using accessories in the GfA Basic editor is now also possible
                     Markers can be defined

Data types

 Apart from the old data types  (Boolean,  integer,  string,  you 
know  what I mean),  Frank Ostrowski has now also  included  some 
more  data  types.  "GfA  Basic" version  3.0  now  includes  the 
following data types:  BOOLEAN (1 bit),  BYTE (1 byte),  CARD  (2 
bytes,  without prefix),  INT (2 bytes, with prefix), LONGINTEGER 
(4 byte),  SINGLE (4 byte, IEEE format, single precision), DOUBLE 
(8 bytes, IEEE format, double precision), FLOAT (8 bytes, GfA 3.0 
format),  CHAR  (strings with 0-byte).  As usual with GfA  Basic, 
data  types  are specified by means of a postfix  (e.g.  "%"  for 
integer variables and "!" for Boolean). These are now added to by 
"|" for BYTE, "&" for WORD and "#" for FLOAT.

 There are some additional array function available, too: QSORT() 
SSORT(), DELETE and INSERT. The maths functions are extended with 
ASIN, ACOS, SINQ and COSQ (math  accuracy increased from 11 to 13 
positions).

Bit operations and interrupt handling

  For the logical machine code freaks,  some  assembler  commands 
have been added to the basic scala:  BCLR, BSET, BTST, BCHG, SHL, 
SHR,  ROL  and ROR.  Commands that belong to the same  family  as 
these  assembler-like command are SWAP() (to swap hi-low  words), 
AND(),  OR(), XOR(), IMP() and EQV(). It is also possible to read 
only  a  part of a variable using the BYTE(),  CARD()  or  WORD() 
commands that are now implemented.
 Interrupt programming (and,  theoretically,  the programming  of 
multi-tasking  programs) should now also be possible,  since  the 
new  "GfA Basic" now also includes commands  like  EVERY,  AFTER, 
EVERY STOP, EVERY CONT, AFTER STOP and AFTER CONT.

Structure commands

 OK.  We already knew IF,  ENDIF, ELSE, THEN and stuff like that. 
But in "GfA Basic" version 3.0, Frank Ostrowski must have thought 
that no wishes should be left open and has also included  ELSEIF, 
SELECT,  CASE TO,  DEFAULT,  OTHERWISE,  ENDSELECT and  CONT.  Of 
course are ENDFOR,  ENDREPEAT,  ENDWHILE,  ENDDO,  DO  WHILE,  DO 
UNTIL, LOOP WHILE and LOOP UNTIL also included, whereas it is now 
not  necessary anymore to put RETURN at the end of  a  procedure; 
ENDPROC and ENDSUB are added for this.

LOGO commands

Mr. Ostrowski must have been a bit drunk when he implemented some 
of the graphic commands like FORWARD,  RIGHT,  BACK, LEFT, TT, PU 
and PD. With the six variables DRAW(0) to DRAW(5), it is now also 
possible to get the current X-and Y coordinates,  the pen  status 
(up or down), X-and Y scaling and the pen curve.

LINE A-, VDI-AND GEM COMMANDS

  One  thing  was known almost at the same instant  at  which  it 
became known that there was to be a "GfA Basic" version  3.0:  It 
was  to  include a lot of GEM commands and all LINE  A  commands, 
thus assuring easier use of GEM by the user. After all, GEM is  a 
bit difficult to program.  With version 3.0 of "GfA Basic",  this 
problem should now be solved.
 A list of all new GEM commands is included in the command  list, 
that is coming up next.  I owe thanks to the German magazine  "ST 
Computer", from which I took this list. Thank you, R. Peiler!

List of the GfA Basic 3.0 commands

     DEFxxx                        DEFLIST

Arrays

     DIM                           DIM?
     OPTION BASE                   ARRAYFILL

Data type conversion

     ASC()                         CHR$()
     STR$()                        BIN$()
     OCT$()                        HEX$()
     VAL()                         VAL?()
     CVx()                         MKx()
     CINT()                        CFLOAT()

Pointer Operations

     *                             BYTE{}
     CARD{}                        INT{}
     LONG{}                        {}
     FLOAT                         SINGLE{}
     DOUBLE{}                      CHAR{}
     xPEEK                         xPOKE
     V:                            VARPTR
     ARRPTR                        ABSOLUTE

Clear and swap

     CLEAR                         CLR
     ERASE                         SWAP
     SSORT                         QSORT
     INSERT                        DELETE

Reserved variables

     FALSE                         TRUE
     PI                            DATE$
     TIME$                         TIMER
     SETTIME

Special

     LET                           VOID
     ~

Memory management

     FRE                           BMOVE
     BASEPAGE                      HIMEM
     RESERVE                       MALLOC
     MSHRINK                       MFREE

Mathematical functions

     ABS                           SGN
     ODD                           EVEN
     INT                           TRUNC
     FIX                           FRAC
     ROUND                         MAX
     MIN                           SQR
     EXP                           LOG
     LOG10                         SIN
     COS                           SINQ
     COSQ                          TAN
     ATN

Random number generation

     RDN                           RANDOM
     RAND                          RANDOMIZE

Commands and arithmetics

     DEC                           INC
     ADD                           SUB
     MUL                           DIV
     PRED()                        SUCC()
     ADD()                         SUB()
     MUL()                         DIV()
     MOD()

BIT operations

     BCLR                          BSET
     BTST                          BCHG
     SHL                           SHR
     ROL                           ROR
     AND()                         OR()
     XOR()                         IMP()
     EQV()                         SWAP()
     BYTE()                        CARD()

String manipulations

     LEFT$                         RIGHT$
     MID$ (command and function)   PRED
     SUCC                          LEN
     INSTR                         RINSTR
     STRING$                       SPACE$
     SPC                           UPPER$
     LSET                          RSET

Keyboard input

     INKEY$                        INPUT
     LINE INPUT                    FORM INPUT
     FORM INPUT AS

Screen output

     PRINT                         PRINT AT()#
     LOCATE                        PRINT USING
     PRINT AT() USING              DEFNUM
     CRSCOL                        CRSLIN
     POS                           TAB
     HTAB                          VTAB
     KEYPAD                        KEYTEST
     KEYGET                        KEYLOOK
     KEYPRESS                      KEYDEF

Data lines

     DATA                          READ
     RESTORE

File management

 Directories

     DFREE()                       CHDRIVE
     DIR$                          CHDIR
     DIR TO                        FILES TO
     MKDIR                         RMDIR

 Files

     EXIST                         OPEN
     LOF()                         LOC()
     EOF()                         CLOSE
     TOUCH                         NAME AS
     KILL                          BLOAD
     BSAVE                         BGET
     BPUT

 Sequential/indexed sequential access

     INP#                          OUT#
     INPUT$#                       INPUT#
     LINE INPUT#                   STORE#
     RECALL#                       PRINT#
     PRINT# USING                  SEEK
     RELSEEK

 Access to free choice

     FIELD AS                      AT
     RECORD                        GET#
     PUT#

Peripherals

 Bytewise in-and output

     INP()                         INP?()
     OUT()                         OUT?()

 Serial/MIDI interface

     INPAUX$                       INPMID$

 Mouse and joystick

     MOUSE                         MOUSEX
     MOUSEY                        MOUSEK
     SETMOUSE                      HIDEM
     SHOWM                         STICK()
     STICK x                       STRIG

 Printer

     LPRINT                        LPOS()
     HARDCOPY

Music

     SOUND                         WAVE

Selection directions

     IF                            THEN
     ELSE                          ELSEIF
     ENDIF

Multiple branches

     ON GOSUB                      SELECT CASE TO DEFAULT
                                    OTHERWISE
     ENDSELECT CONT

Loops

     FOR TO STEP NEXT ENDFOR       REPEAT UNTIL ENDREPEAT
     WHILE WEND ENDWHILE           DO LOOP ENDDO DO WHILE DO
                                    UNTIL
     LOOP WHILE LOOP UNTIL         EXIT IF

Subroutines

     GOSUB                         PROCEDURE RETURN ENDPROC
                                    ENDSUB
     LOCAL                         VAR
     FUNCTION ENDFUNC RETURN x
      DEFFN

Conditional branches

     ON BREAK                      ON BREAK CONT
     ON BREAK GOSUB                ON ERROR
     ON ERROR GOSUB                RESUME
     RESUME NEXT                   ERROR
     ERR                           ERR$
     FATAL

Interrupt programming

     EVERY                         EVERY STOP
     EVERY CONT                    AFTER
     AFTER STOP                    AFTER CONT

Miscellaneous

     REM                           GOTO
     PAUSE                         DELAY
     END                           EDIT
     STOP                          SYSTEM
     QUIT

Error handling

     TRON                          TROFF
     TRON PROCEDURE                TRACE$
     DUMP

Graphic definition commands

     SETCOLOR                      COLOR
     DEFMOUSE                      DEFMARK
     DEFFILL                       BOUNDARY
     DEFLINE                       DEFTEXT
     GRAPHMODE

General graphic commands

     PLOT                          LINE
     DRAW                          DRAW TO
     BOX                           PBOX
     RBOX                          PRBOX
     CIRCLE                        PCIRCLE
     ELLIPSE                       PELLIPSE
     POLYLINE OFFSET               POLYMARK OFFSET
     POLYFILL OFFSET               POINT()
     FILL                          CLS
     TEXT                          SPRITE

Screen blocks

     SGET                          SPUT
     GET                           PUT

Condition manipulation

     ON MENU                       MENU()
     ON MENU BUTTON                ON MENU KEY GOSUB
     ON MENU IBOX GOSUB            ON MENU OBOX GOSUB
     ON MENU MESSAGE GOSUB

Pull-down menus

     MENU m$()                     ON MENU GOSUB
     MENU OFF                      MENU KILL
     MENU

Window commands

     OPENW                         CLOSEW
     CLEARW                        TITLEW
     INFOW                         TOPW
     FULLW                         WINDTAB

Miscellaneous

     ALERT                         FILESELECT

System routines

     L:                            W:
     GEMDOS                        BIOS
     XBIOS

Line-A calls

     PSET                          PTST
     ALINE                         HLINE
     ARECT                         APOLY TO
     BITBLT                        ACHAR
     ATEXT                         ACLIP

VDI calls

     CONTRL                        INTIN
     PTSIN                         PTSOUT
     INTOUT                        VDISYS
     VDIBASE                       WORK_OUT()

GEM AES calls

     GCONTRL                       ADDRIN
     ADDROUT                       GINTIN
     GINTOUT                       GB
     GEMSYS

Subroutine calls

     C:                            MONITOR
     CALL                          RCALL
     EXEC

Application library

     APPL_INIT                     APPL_READ
     APPL_WRITE                    APPL_FIND
     APPL_TPLAY                    APPL_TRECORD
     APPL_EXIT

Event library

     EVNT_KEYBD                    EVNT_BUTTON
     EVNT_MOUSE                    EVNT_MESAG
     EVNT_TIMER                    EVNT_MULTI
     EVNT_DCLICK

Menu library

     MENU_BAR                      MENU_ICHECK
     MENU_IENABLE                  MENU_TNORMAL
     MENU_TEXT                     MENU_REGISTER

Object library

     OBJC_ADD                      OBJC_DELETE
     OBJC_DRAW                     OBJC_FIND
     OBJC_OFFSET                   OBJC_ORDER
     OBJC_EDIT                     OBJC_CHANGE

Form library

     FORM_DO                       FORM_DIAL
     FORM_ALERT                    FORM_ERROR
     FORM_CENTER                   FORM_KEYBD
     FORM_BUTTON

Graphics library

     GRAF_RUBBERBOX                GRAF_MOVEBOX
     GRAF_DRAGBOX                  MOVE_GROWBOX
     GRAF_SHRINKBOX                GRAF_WATCHBOX
     GRAF_SLIDEBOX                 GRAF_HANDLE
     GRAF_MOUSE                    GRAF_MKSTATE

Scrap library

     SCRP_READ                     SCRP_WRITE

Fileselect library

     FSEL_INPUT

Window library

     WIND_CREATE                   WIND_OPEN
     WIND_CLOSE                    WIND_DELETE
     WIND_GET                      WIND_SET
     WIND_FIND                     WIND_UPDATE
     WIND_CALC

Resource library

     RSRC_LOAD                     RSRC_FREE
     RSRC_GADDR                    RSRC_SADDR
     RSRC_OBFIX

Shell library

     SHEL_READ                     SHEL_WRITE
     SHEL_GET                      SHEL_PUT
     SHEL_FIND                     SHEL_ENVRN

Concluding

  After having read this,  you will now probably think  that  the 
program  is  now  enormously  BIG,   clumsy  and  slow.  But  no! 
Averagely, "GfA Basic" 3.0 is 20% faster in its calculations (and 
the new compiler,  available in half a year or so,  will add even 
more  to that),  and the program is not even 90 Kb in  size  with 
about 390 commands in total!
 I'd consider "GfA Basic" version 3.0 a programming language that 
will  be  quite difficult (mind you:  This is meant as  quite  an 
understatement) to improve.  About every command you ever  wished 
is  now prominently present.  But you're right,  and therefore  I 
used the word 'about' in the previous sentence:  There are  still 
some  wishes  open.  There's  the lack of  an  on-line  assembler 
possibility (like in the BBC computers and the  Archimedes),  for 
example,  and  I also miss the OLD command.  There must  be  more 
things that are missing, but I can't think of any.
  "GfA  Basic" version 3.0 (selling at DM 198,-- in  Germany  and 
ƒ269,--  in Holland) is EXCELLENT.  If you have  the  money,  you 
should  get  it as soon as it's available (which should  be  when 
you're  reading  this or earlier).  Frank  Ostrowski  once  again 
proves that Basic is not just a trashy programming language!

For info, contact:

GfA Systemtechnik
Heerdter Sandberg 30
D-4000 Düsseldorf 11
West Germany
Tel. 0211-588011

Marko Software
Jos. de Jongstraat 32-34
3314 VB  Dordrecht
The Netherlands
Tel. 078-132779
     078-132279

Disclaimer
The text of the articles is identical to the originals like they appeared in old ST NEWS issues. Please take into consideration that the author(s) was (were) a lot younger and less responsible back then. So bad jokes, bad English, youthful arrogance, insults, bravura, over-crediting and tastelessness should be taken with at least a grain of salt. Any contact and/or payment information, as well as deadlines/release dates of any kind should be regarded as outdated. Due to the fact that these pages are not actually contained in an Atari executable here, references to scroll texts, featured demo screens and hidden articles may also be irrelevant.