EasyManua.ls Logo

Radio Shack TRS-80 Model 4 - Page 143

Radio Shack TRS-80 Model 4
418 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter
2/
Command And Execution Modes
This chapter describes BASIC's command and execution modes. The
command mode
is
for typing
in
program lines and immediate lines.
The execution mode
is
for executing programs and immediate lines.
Command
Mode
Whenever you enter the command mode, BASIC displays the prompt:
Rea
d,'
In
the command mode, BASIC does not "read" your input until you
complete a "logical line"
by
pressing
(ENTER).
This
is
called "line
input",
as
opposed to "character input".
A logical line
is
a string of
up
to 255 characters and
is
always
terminated by pressing
(ENTER).
Of these 255 characters, 249 are
reserved for the line itself; the other six are reserved for the line
number and the space following the line number.
A physical line,
on
the other hand, is one line
on
the display.
It
contains a maximum of 80 characters.
For example, if
you
type 100 R's and then press
(ENTER),
you have
two physical lines, but only one logical line.
Interpretation of a Line
BASIC always ignores leading spaces
in
the line - it jumps ahead to
the first non-space character.
If
this character is not a digit, BASIC
treats the line
as
an
immediate line.
If
it is a digit, BASIC treats the
line
as
a program line.
For example, if you type:
PRINT
"THE TIME
IS"
TIME$
(ENTER)
BASIC takes this
as
an
immediate line.
But if you type:
10
PRINT
"THE TIME
IS"
TIME$
(ENTER)
BASIC takes this
as
a program line.
Immediate
Lines
An
immediate line consists of one or more statements separated by
colons. The line is executed
as
soon
as
you press
(ENTER).
For
example:
Read,'
CLS:
PRINT
"THE SQUARE
ROOT
OF
Z
IS"
SQR(Z)
is
an
immediate line. When you press
(ENTER),
BASIC executes
it.
2-13

Other manuals for Radio Shack TRS-80 Model 4

Related product manuals