EasyManua.ls Logo

Radio Shack TRS-80 Model 4 - Page 272

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...
PRINT#
Statement
PRINT# buffer, item1, item2,
...
Prints data items
in
a sequential disk file.
Buffer is the buffer number used
to
OPEN the file for input.
When you first OPEN a file for sequential output, BASIC sets a
pointer to the beginning of the file - that's where PRINT# starts
printing the values of the
items.
At
the end of each PRINT#
operation, the pointer advances, so values are written
in
sequence.
A PRINT# statement creates a disk image similar
to
what a PRINT to
the display creates
on
the screen. For this reason, make sure to
delimit the data so that
it
will
be
input correctly from the disk.
PRINT# does not compress the data before writing it
to
disk. It writes
an
ASCII-coded image of the data.
Examples
If
A =
123.L15
PRINT#
itA
writes this nine-byte character sequence onto disk:
~123.L15~
carria~e
return
The punctuation
in
the PRINT list
is
very important. Unquoted
commas and semicolons have the same effect
as
they do
in
regular
PRINT statements
to
the display. For example, if A = 2300 and B =
1.303, then
PRINT#
it
AtB
(ENTER)
writes the data
on
disk as
~
2300
~~~~~~~~~~
1.303~
carria~e
return
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 semicolons instead of commas.
Files can
be
written
in
a carefully controlled format using PRINT#
USING. You can also use this option
to
control how many characters
of a value are written to disk.
2-146

Other manuals for Radio Shack TRS-80 Model 4

Related product manuals