Syntax
where L is the name of a label and is a valid
input channel number.
The GOTO: command is used to switch program flow unconditionally
to the address given. This command is thus the memoryless analogue of
the M: command, and is not linked with a RETURN:
command. You should be careful if you want to jump out of FOR:
loops. The GOTO: command is not associated with a return
address: therefore whenever the end-of-file marker is encountered after
a GOTO: command has been issued, the program returns to the
address associated with the most recent M: command or stops
otherwise. The same holds when a RETURN: command is encountered
after a GOTO: command. See the discussion in §2.7 for
further details.
If the first form of the command is issued, with no channel number being
specified, the channel number is deduced - [B/D] does not allow
duplicate labels. In the third form of the syntax, the beginning of the
file associated with the input channel is indicated. In common with
other macro facilities, the channel number can be zero (meaning the
keyboard): a label should
not be supplied in this case. The address implied by the channel and
label supplied must exist at the time the command is issued.
Commands which might result in diverting
program flow (GOTO: , M: , and RETURN: ) must be
issued on a separate line; otherwise an error is reported. Hence the
following usage is not permitted:
BD>for : i=1,1,2 goto : @test[i]
The following fragments of code show three examples.
The first example refers explicitly to the label ``@lisbon''. No channel
number is given, so [B/D] will search all the input channels for a
match. There may be at most one match as [B/D] does not permit duplicate
labels. The address thus consists of the given label, on a channel which
will be deduced. In the second example, the address consists explicitly
of a label and a channel number. In the third example, no label is
given, and the top of the external file associated with input channel
number 2 will be assumed as the required address.