Download Print this page

Radio Shack TRS-80 Owner's Manual page 150

Mini-disk operation disk operating system disk basic programming language
Hide thumbs Also See for TRS-80:

Advertisement

A
print#
statement
creates
a disk
image
similar
to
what
a
print
to
display
creates
on
the screen.
Remember
this,
and
you'll
be
able
to set
up your
print'#
list
correctly for
access
by one
or
more
input
statements.
print#
does
not
compress
the data
before writing
it
to disk;
it
writes
an
ascii-
coded image
of
the data.
For example,
if
a
=
123.45
PRINT#1
>A
will
write a nine-byte character
sequence onto
disk:
123,45
(INTER)
The
punctuation
in
the
print
list is
very important.
Unquoted
commas
and semi-
colons
have
the
same
effect as
they
do
in
regular
print
to
display statements.
For example,
if
a
=
2300
and B
=
1.303,
then
PRINT#1
»A»B
places
the data
on
disk
as
2300
1.303
(ENTER)
The
comma
between
a
and
b
in
the
print#
list
causes 10
extra
spaces
in
the
disk
file.
Generally
you
wouldn't
want
to
use
up
disk space
this
way,
so
you
should use semi-colons
instead
of
commas.
PRINT*1
?A5B
writes the data
as:
2300
1,303
(ENTER)
print#
with
numeric
data
is
quite straightforward
just
remember
to
separate
the
items with semi-colons.
print#
with
string
data requires
more
care,
primarily
because
you have
to insert
delimiters so the data
can be
read
back
correctly.
In
particular,
you must
separate
string
items with
explicit delimiters
if
you want
to
input# them
as
distinct strings.
For example,
suppose:
A*="J0HN
0,
DOE" and B$=" 100-0 1-001"
Then:
PRINT»1
t
a$;b$
would
produce
this
image
on
disk:
JOHN
Q.
DOE100-01-001
(1WTER)
which
could
not
be input back
into
two
variables.
The
statement:
132

Advertisement

loading

This manual is also suitable for:

Model iii