
A6.7 Statements 139
possible to rewrite the code such that no gotos are required. The target of a goto is a
label.
A gosub is similar to a goto, with the exception that a subsequent return jumps
to the point immediately after the gosub statement.
The pop commands is used to handle the arguments of gosub, goto,andreturn.
If a goto or gosub has arguments, then the first statement(s) after the target label must
be as many pop statements as there are arguments (note that the arguments are popped
in reverse order). Similarly, if a return has arguments, there must be as many pops
immediately after the gosub statement. This way, gosub is similar to a function call
where the local variables are shared. Usage of gosub is not recommended.
A6.7.6 Command statements
A6.7.6.1 print and format command
print-command:
print options
opt
expression-list
opt
;
opt
;
format-command:
format options;
format options
opt
width , precision ;
options: one or more of:
/type /onoff /rowsep /fmt
The print and format commands share the same set of options, see Table A6.1.
Options used with print are local to that command, the format options are in force
until changed with the next format command, or locally within a print.Theex-
pression list in print is separated by a space (except for expressions in parenthese or
square brackets). Use two semicolons after print to suppress the newline character.
The default width is 16, and default precision 8. Note that format 16,8 is the same as
format /rd 16,8.
An expression without assignment is an implicit print statement. If it is preceded
by a dollar symbol, the result is printed as a character matrix. A double semicolon after
an implicit print suppresses the newline character.
A6.7.6.2 output command
output-command:
output file-spec
opt
action
opt
;
file-spec:
file = string-constant
file = ^string-variable
action: one of
on of reset
Komentarze do niniejszej Instrukcji