Program Command List - Radio Shack TRS-80 26-3650 Service Manual

Table of Contents

Advertisement

6.
PROGRAM COMMAND
LIST
Classification
Command
Name
Format
Function
Input
statement
INPUT
INPUT
variable string
Causes data to be entered
from
the key-
board during execution
of a program.
The
program
execution
is
stopped
until
after
the
end
of
input.
KEY
Character
variable
=
KEY
Reads
a
character entered during
execu-
tion
of a
program and
assigns
it
to
a
character
variable.
Since the
program
is
not stopped
by
this
command,
nothing
is
assigned to
the
character
variable
if
no key
entry
is
made.
Output
statement
PRINT
PRINT
output
control
function
J
'
I
output element J
'
I
.
.
.
Outputs
the designated
output
element.
CSR
CSR
n<j
;
l
(O^n
<^^)
Displays
from
the designated nth
position.
Branching
GOTO
GOTO I""
6
™)
Invariable
1
Causes
control to
jump
to the designated
line
number.
IF...
TTHENl
IF
comparison
expression
TthEN
line
no.
1
\
;
command/
Causes
control to
jump
to the
line
number
following
THEN,
or executes
the
command
following ";",
if
the
result
of the
comparison
is
true.
Causes
control
to proceed
to the
next
line
number
if
the
result
of the
com-
parison
is
false.
GOSUB
GOSUB
(
iinen
°\
[variable!
Calls
out
the subroutine of the
desig-
nated
line
number
for execution.
After
the subroutine
is
executed,
control
returns
to the
GOSUB
statement
by
the
RETURN
statement
to
proceed to
the
command
following that statement.
RETURN
RETURN
Signifies
the
end
of
a
subroutine;
returns control to the
command/statement/
function next to the
GOSUB
statement.
Looping
FOR
FORv
=
e1TOe2[STEPe3]
*v
denotes
a
numerical
variable,
and
el,
e2 and e3
represent
a
numerical
ex-
pression respectively.
Declares the beginning of a
loop
in
which
numerical
value
v
changes
from
initial
value el to terminal value
e2
in
increments of
e3.
The
loop
is
repeated
"e2-e1
,
."
_
+1
times
ej
between
the
FOR
and
NEXT
statements.
If
the
increment
e3
is
omitted,
e3
is
regarded
as
"1".
NEXT
NEXT
v
Signifies
the
end
of
a
FOR
loop.
If
the
result
of v plus
e3
is
equal to or
smaller
than
e2,
the loop
is
repeated
again.
If it is
greater
than
e2, control
proceeds
to the
line
next to
the
NEXT
statement.
-13-

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Trs-80 26-3653Trs-80 26-3651

Table of Contents