Radio Shack TRS-80 Trsdos & Disk Basic Reference Manual page 102

Micro computer system
Hide thumbs Also See for TRS-80:
Table of Contents

Advertisement

DISK BASIC
LINE INPUT
(input a
line
from
keyboard)
LINE
INPVTV'prompt"]
\var$
where
prompt
is
a
prompting message
var$
is
the
name
that
will
be
assigned to
the
line
you
type
in
LINE INPUT
(or
LINEINPUT -
the space
is
optional)
is
similar to
INPUT,
except:
When
the statement
is
executed,
and
the
Computer
is
waiting
for
keyboard
input,
no
question
mark
is
displayed
Each
LINE
INPUT
statement can
assign a
value to
just
one
variable
Commas
and quotes
will
be accepted
as
part
of
the
string
input
Leading
blanks
are
not
ignored
they
become
part
of var$
The
only
way
to terminate the
string
input
is
to press
idfliiasi
LINE INPUT
is
a
convenient
way
to
input
string
data
without having
to
worrv about
accidental entry
of
delimiters
because only the
la^ftid:!
key
serves
as
a delimiter.
If
you want
anyone
to
be
able to
input information
to
a
program
without
special instructions,
use
LINE INPUT
and then
analyze the
resultant
string.
Some
situations
require that
you
input
commas,
quotes
and
leading
blanks
as
part
of the
data.
LINE INPUT
serves well
in
such
cases.
Examples:
LINE
INPUT A*
Input
A$
without
displaying
any prompt.
LINE INPUT"LAST
NAME,
FIRST
NfiME?
M
;N$
Displays
a
prompt
message and
inputs
data.
Commas
will
not
termi-
nate the input
string.
Try
the following
program
to get
the idea
of
LINE
INPUT.
108
-'
PROGRAM: LN INPUT
110
•-
EXAMPLE
OF
LINEINPUT STATEMENT
120
'
130 CLEAR 300: CLS
140 PRINT
TAEK15);
"LINE INPUT STATEMENT": PRINT
150 PRINT: PRINT "*** ENTER TEXT ***«
151
•'
152
'
*** GET
STRING,
THEN PRINT
IT
***
153
'
155 A*=
M "
'SET A$ TO NULL
STRING
7-16

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents