Program Command List - Radio Shack TRS-80 Service Manual

Pc-4 pocket computer and cassette interface
Hide thumbs Also See for TRS-80:
Table of Contents

Advertisement

6. PROGRAM COMMAND LIST
C.. ssification
Command
Format
Function
Name
Input
INPUT
INPUT variable string
Causes data to be entered from the key-
statement
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 duringexecu-
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
PRINT
PR INT output control
Outputs the designated output element.
statement
function
f}
output
ele~nt
({} ..
.J
CSR
CSR n{} (0
~
n
~
11)
Displays from the designated nth
position.
-
Branching
GOTO
GOTO {line no. }
Causes control to jump to the designated
variable
line number.
IF ...
IF comparison expression
Causes control to jump to the line
{TH;EN}. ..
{THEN line no.
J
number following THEN, or executes
;
command
the command following" ;", if the
result of the comparison is true.
Causes control
10
proceed to the next
line number if the result of the com-
parison is false.
GOSUB
GOSUB
~inenoJ
Calls out the subroutine of the
desig-
variable
nated line number for execution. After
the subroutine is executed, control
returns to the GOSUB statement
by
the
RETU RN 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
FOR v
=
e1 TO e2 [STEP e31
Declares the beginning of a loop in
*v denotes a numerical
which numerical value v changes from
variable, and e1, e2 and e3
initial value elto terminal value e2 in
represent a numerical ex-
increments of e3. The loop is repeated
pression respectively.
"e2 - e1
"
- - + 1
times
e3
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 pc-426-365026-365126-3653

Table of Contents