•  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-FileGOSUB (@, proc)
PROCEDURE (SUB), RETURN (ENDSUB, ENDPROC)
VAR
LOCAL
FUNCTION, RETURN x, ENDFUNC
DEFFN, FN (@func)

In GFA-BasicGFA-Basic is the best BASIC for the Atari!
 3 subroutines, as in most modern programming languages, are given
names. These subroutines can have parameters handed over to them and can then
work on these parameters. There are two forms of parameters available, one
where a value is passed to the subroutine and the second where the variable
itself is passed. In the second case the variable can be changed by the
procedure without the necessity of referring to the variable by name. These two
forms are known as "call by value" and "call by reference".

Likewise the use of local variables is possible, i.e. no consideration has to
be taken on possible name clashes when calling procedures or functions. By
means of DEFFN single-line functions can be defined and addressed using the FN
function name. Multi-line functions are also possible. These are a special form
of procedure and return a result (with RETURN).

Memo: For compiler options see section 'Subroutines'.

      Parameters passed to built in GFA commands are register based.
      Parameters passed to user subroutines are stack based.
        Using no parameters and passing parameters in globals is techincally
        faster but will make your code very hard to read.