Jump Command (Goto) - Radio Shack TRS-80 PC-4 Owner's Manual

Trs-80 pc-4
Hide thumbs Also See for TRS-80 PC-4:
Table of Contents

Advertisement

Using the value of this numerical expression, a position on the display can be designated
as the starting place for data to appear.
The method for counting the positions on the display is shown below.
[J [J
DD DDDUD
I
RUN
I
Ii
1"1
I
I,
"
1
L-.J
U
I
e
Example:
2
3
4
5
r-I
I
LJ
6
7
8
9
1
e
1 1
PRI NT A
(make A=12345)
PRINT
CSR
1; A
PRINT
CSR 5;A
PRINT B$
(make B$
=
ABCDE)
PRINT CSR 2; B$
PRINT CSR 10; B$
12345
12345
12345
j - - - - - - - - - , - , ~ - - - -
ABCDE
-
ABCDE
AS
1 - - - ' - - - - - - - - - - - -
ABCDE
*
If a " , " (comma) is used instead of a
/I;"
(semicolon) following the
CSR
function,
the display will be cleared once and then successive displays wi II begin from the left
by using the
II
Key.
5-6-3 Jump Command
GOTO statement
A GOTO statement, also called an "unconditional jump", causes program execution
to continue at designated location (line number) unconditionally.
Format: GOTO { numeric~1 expressio~
line number
(1
through 99991
#
numerical expression
program area number
(0 through 9)
When
a
numerical expression is written immediately following the GOTO statement,
program execution jumps to a line number. When a
"#"
is written immediately
following the GOTO statement, program execution jumps to a program area.
The numerical expression may be
a
numerical value,
a
variable or a calculation formula.
Example:
GOTO
10'
GOTO N
......... jump to line 10
......... jump to the line number which is the value of variable N
(jump to line 30 if N is 30)
-47-

Advertisement

Table of Contents
loading

Table of Contents