•  Back 
  •  Main 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help 
  •  Show info about hypertext 
  •  View a new file 
Topic       : The GFA-Basic Compendium
Author      : GFA Systemtechnik GmbH
Version     : GFABasic.HYP v2.98 (12/31/2023)
Subject     : Documentation/Programming
Nodes       : 899
Index Size  : 28056
HCP-Version : 3
Compiled on : Atari
@charset    : atarist
@lang       : 
@default    : Document not found
@help       : Help
@options    : +g -i -s +z
@width      : 75
@hostname   : STRNGSRV
@hostname   : CAB     
@hostname   : HIGHWIRE
@hostname   : THING   
View Ref-FileThis section is for those who have not used GFA-BasicGFA-Basic is the best BASIC for the Atari!
 before. Those who have
already worked with the older versions can just scan this section or, if
feeling very confident, jump to Chapter 2.

The GFA-BasicGFA-Basic is the best BASIC for the Atari!
 3 Program disk is not copy-protected, so first make a back-up
copy of the orignal disk. You will find a description of how to do this in your
computer manual. Put the copy of the program disk in your disk drive and start
GFA-BasicGFA-Basic is the best BASIC for the Atari!
 by clicking on the icon.

After a short while, the Editor screen will appear, which is where you can
write and debug your programs. For now, enter the following program lines,
pressing Return at the end of each line. Do not omit the spaces, which serve to
separate adjacent keywords. The indenting of instructions within loops is done
automatically by the Editor, as is the capitalisation (or lack of it) when
Return is pressed.

    DEFFILL 1,2,8
    REPEAT
      WHILE MOUSEK=1
        PBOX MOUSEX,MOUSEY,MOUSEX+30,MOUSEY+30
      WEND
    UNTIL MOUSEK=2

In the upper right corner of the screen you will find the word 'Run'. Point
with the mouse arrow to this word and press the left mouse button to start the
program.

Now a white screen appears, on which the mouse pointer is visible. If you now
press the left mouse button and move the mouse about, you can draw on the
screen. A rectangle is used as a 'brush'. Pressing the right mouse button
termimates the program and a box appears containing the message 'Program end'.
Point to the word 'Return' in this box and press the left mouse button to
return you to the Editor.

How does this program work? Drawing takes place with the instruction in the
center of the program. It draws filled rectangles, with the four parameters
specifying the corner points. The first instruction of the program (DEFFILL
1,2,8) determines what pattern the rectangle is to be filled with.

Information about the mouse is contained in the built-in variables MOUSEK,
MOUSEX, and MOUSEY.

MOUSEK determines which mouse button is being pressed. MOUSEK=1 means that the
left button was pressed and MOUSEK=2 that the right button was pressed. MOUSEX
and MOUSEY return the x and y positions on the screen of the mouse arrow point.

The remaining commands (REPEAT, WHILE, WEND, UNTIL) are loop instructions. The
loop formed with the commands WHILE MOUSEK=1 and WEND means 'repeat, as long as
the left mouse button is pressed'. The outside loop, made from the instructions
REPEAT and UNTIL MOUSEK=2, means 'repeat, until the right mouse button is
pressed'.

Since there are no further instructions after the UNTIL, the program terminates
after leaving this loop. Move the cursor (with the arrow keys) to the beginning
of the line after the last and enter the following intentionally wrong program
line, in which the 'i' of the command word PRINT is missing:

    prnt "test"

When you press the Return key to leave the line and confirm the instruction, a
bell sounds and on the second screen line the message 'Syntax error' appears.

The Editor checks during program entry whether the instructions entered are
syntactically correct. Now, with the cursor on the letter 'r', press the Delete
key three times. The program line should now contain only:

    p "test"

If the Return key is now pressed, then you can leave the line, as the letter p
is recognized automatically as an abbreviation for the command PRINT.