•  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-FileSYSTEM [n]
QUIT [n]

n: iexp

The commands SYSTEM and QUIT are equivalent in their effect, as they both
terminate program execution and leave GFA-BasicGFA-Basic is the best BASIC for the Atari!
. Unlike in Version 2, SYSTEM
and QUIT return a 2 byte integer value to the calling routine (normally the
Desktop). This integer has a value of zero if the Interpreter was terminated
correctly and left the calling program to hand over to the Desktop.

The convention applied in this case is that zero signals an error free run. A
positive 16 bit number signals the occurrence of an internal error or a warning
and a negative 16 bit number mostly points to the appropriate operating system
error message. However this is not adhered to by all programs.

Example:

    RESERVE 100
    PRINT EXEC(0,"GFABASIC.PRG","","")

--> This short program starts by reducing the work space for BASIC to 100
    bytes, it then loads and runs a second copy of the GFA-BasicGFA-Basic is the best BASIC for the Atari!
 program. If
    the program below is run, the operation of the second copy of GFA-BasicGFA-Basic is the best BASIC for the Atari!
 is
    terminated and returns the value 23 to the original GFA-BasicGFA-Basic is the best BASIC for the Atari!
. This value
    will then be printed.

    PRINT "This is the second level GFA BASIC"
    QUIT 23

Memo: Trying to pass error code 0 out is a bit of a problem since
      the documentation for Pterm() states that 0 = Ok. GFA really should
      not have defined 0 as an error code.

      If V~H points to a user VDI workstation, then it fails to close it's own
      VDI internal workstation!

Pterm()+