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-FileCursor control is by means of the block of arrow keys. The key settings are:
Left arrow - cursor moves one character to the left
Right arrow - cursor moves one character to the right
Up arrow - cursor moves up one line
Down arrow - cursor moves down one line
The movements of the cursor are subject to certain restrictions. It can be
moved a maximum of one character beyond the last character in a line, and a
maximum of one line beyond the last line in a program. If the cursor enters a
line which is too short for the current cursor position, the cursor jumps to
the end of that line, otherwise it maintains its current column position (this
is different to the behaviour of the cursor in earlier versions of ).
It also is possible to position the cursor with the mouse. To do this point the
mouse arrow to the desired place and click the left mouse button.
The Insert key inserts a blank line between the line the cursor is on and the
line above. The cursor is set to the beginning of this blank line.
Clr/Home moves the cursor to the upper left corner under the menu bar.
Control-Clr/Home jumps to the beginning of the program listing.
The Undo key will cancel any changes made in an edited line, provided that the
changes have not been confirmed by moving the cursor off that line.
With the Help key, procedures or functions in the program listing can be
shortened to just their name ('folded'). This is done by moving the cursor to
the line with the word PROCEDURE or FUNCTION on it and then pressing Help. A
'>' character is placed at the beginning of the line to indicate that folding
has occurred. The procedure or function can be unfolded in the same way, or by
deleting the '>'. Of course this does not affect the procedure or function in
the program itself, only as listed. This folding up of subroutines enables one
to create short clear listings in which one 'opens' only the subroutine on
which one is working.
A program with folded up procedures can look as follows. Note, that to call a
procedure in 3 only the procedure name is used.
init
main_menu
'
> PROCEDURE init
> PROCEDURE main_menu
> PROCEDURE menu_list
> PROCEDURE load
> PROCEDURE store
> PROCEDURE do_work
> PROCEDURE fetch_info
> PROCEDURE show_info
> FUNCTION test_info
With an opened procedure the program then appears as:
init
main_menu
'
> PROCEDURE init
> PROCEDURE main_menu
> PROCEDURE menu_list
PROCEDURE load
FILESELECT "\*.RSC","",rsc_file$
IF NOT EXIST(rsc_file$)
ALERT 1,"File does not exist !",1,"abort",r%
ELSE
IF RSRC_LOAD(rsc_file$)=0
ALERT 1,"Fault when loading the file !",1,"abort",r%
END
ENDIF
ENDIF
RETURN
> PROCEDURE store
> PROCEDURE do_work
> PROCEDURE fetch_info
> PROCEDURE show_info
> FUNCTION test_info
Control-Help:
Pressing Control-Help on a PROCEDURE line will fold or unfold all subroutines
starting at this one. Like the Help key, it depends on the state or this
PROCEDURE.