Specifications

BASIC commands
PROGRAMMING MANUAL 95
Revision 5.0
3.2.137 GOSUB..RETURN
/i
3.2.138 GOTO
/i
3.2.139 HALT
/i
3.2.140 HEX
/i
Type Program control command
Syntax GOSUB label
...
RETURN
Description The GOSUB structure enables a subroutine jump. GOSUB stores the position
of the line after the GOSUB command and then jumps to the specified label.
Upon reaching the RETURN statement, program execution is returned to the
stored position.
Note: Subroutines on each task can be nested up to 8 levels deep.
Arguments label
A valid label that occurs in the program. An invalid label will give a compi-
lation error before execution.
Labels can be character strings of any length, but only the first 15 charac-
ters are significant. Alternatively line numbers may be used as labels.
Example main:
GOSUB routine
GOTO main
routine:
PRINT "Measured position=";MPOS;CHR(13);
RETURN
See also GOTO
Type Program control command
Syntax GOTO label
Description The GOTO structure enables a jump of program execution. GOTO jumps pro-
gram execution to the line of the program containing the label.
Arguments label
A valid label that occurs in the program. An invalid label will give a compi-
lation error before execution.
Labels can be character strings of any length, but only the first 15 char-
acters are significant. Alternatively line numbers may be used as labels.
Example loop:
PRINT "Measured position = ";MPOS;CHR(13);
WA(1000)
GOTO loop
See also GOSUB..RETURN
Type System command
Syntax HALT
Description The HALT command stops execution of all program tasks currently running.
The command can be used both on Command Line Terminal as in programs.
The STOP command can be used to stop a single program task.
Note: HALT doesn’t stop any motion. Currently executing, or buffered moves
will continue unless they are terminated with a CANCEL or RAPIDSTOP com-
mand.
Arguments N/A
Example No example.
See also PROCESS, STOP.
Type I/O command
Syntax HEX
Description This command is used in a print statement to output a number in hexadecimal
format.
Arguments N/A