Installation guide
Programming Commands 109
GETCHAR I/O Command
ACTION: Waits for a character on the selected serial port and returns the ASCII
code of the character.
PROGRAM SYNTAX: GETCHAR(n) - used in an expression
REMARKS: The n specifies the serial port number (1 or 2). Port 1 is the Host Port
and Port 2 is the Auxiliary Port.
Program execution is suspended while GETCHAR waits for a character
to be received by the designated port. If a character is already in the re-
ceiver buffer the ASCII code of the character is returned immediately.
EXAMPLES: a=GETCHAR(1) ‘ sets a to the ASCII code of Host Port character
b=GETCHAR(2) ‘ sets b to the ASCII code of Aux Port character
a$=a$ + CHR$(a) ‘ add Host character to a$
b$=b$ + CHR$(b) ‘ add Auxiliary character to b$
GOSUB ... RETURN Program Flow Control
ACTION: Branches to, and returns from, a subroutine.
PROGRAM SYNTAX: GOSUB line label
REMARKS: You can call a subroutine any number of times in a program. You can call
a subroutine from within another subroutine, this is called nesting.
How deeply you can nest is limited only by the available stack area. Sub-
routines that call themselves (recursive subroutines) can easily run out of
stack space.
The execution of the RETURN statement cause program execution to
continue with the line immediately following the line that called the sub-
routine.
Subroutines can appear anywhere in the program, but it is good pro-
gramming practice to make them readily distinguishable from the main
program.
EXAMPLES: GOSUB GET_CHAR
statements
END
GET_CHAR:
statements
RETURN










