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 will try and explain what happens when GFABASIC starts and terminates. The code you can't really control. The basic layout of a compiled GFA program is like so: INIT module your code EXIT module What does the INIT module do exactly: Calculates how much BSS space it needs and clears it. Moves the stack pointer to the BSS. MSHRINK() is called. Skipped if started as an ACC, OS auto shrinks an ACC. Line-A Init is called. This is harmless, used by the Line-A gfx commands. APPL_INIT() is called. The appl_id is saved. V_OPNVWK() is called. The vdi_handle is saved. No clipping rectangle is set. WORK_OUT() array is created. Default VDI workstation values are setup. If any GFA window commands are linked, WINDTAB() structure is initialized. MALLOC($Mxxx) is called. If $Mxxx=0 all ram is allocated for strings/arrays. CLEAR is called. All Variables are cleared. RESTORE is called. First DATA statement is located for READ. User code starts here... What does the EXIT module do exactly: User code ends here with EDIT, QUIT, or SYSTEM... If any GFA window commands are linked, all open GFA windows are closed. V_CLSVWK() is called. APPL_EXIT() is called. CLOSE (no parameter) is called. All open files are closed. pterm() is called. User error code is passed out via SYSTEM/QUIT. Note: GFA does not call MFREE() as it assumes pterm() will auto free the ram.