Sharp MZ-700 Series Owner's Manual page 70

Personal computer
Hide thumbs Also See for MZ-700 Series:
Table of Contents

Advertisement

2.3.10 Data file input/output commands
Although the SAVE and LOAD commands can be used to write or read program text, other commands
are used to record or read the various types of data which is handled by programs. These commands
are described below.
Format
Function
WOPEN
(abbreviated W.)
WOPEN < file name >
Opens a data file on cassette tape
prior to writing data to it. This
command also assigns a name to
the data file.
PRINT/T
(abbreviated ?/T)
PRINT/T d
x
< , d
2
, d
3
, . . . dn >
dn . . . . Numeric data or string data
Writes data to cassette tape in the
same format as it would be displayed
by the PRINT statement.
ROPEN
(abbreviated RO.)
ROPEN < file name >
Searches for the data file on cassette
tape with the specified name and
opens that file to prepare for reading
data from it.
INPUT/T
(abbreviated I./T)
INPUT/T
V l
< , v
2
, v
3
, . . . vn >
vn . . . . Numeric data or string data
Used to input data from a cassette
file and pass it to the program (in a
manner similar to that in which the
INPUT statement is used to input
data from the keyboard).
CLOSE
(abbreviated CLO.)
CLOSE
Statement which closes cassette data
files
after writing or reading has
been completed.
Unlike the LOAD and SAVE commands, no messages are displayed by execution of the WOPEN and
ROPEN statements.
If display of a message is desired, use the PRINT statement to define one in the program.
Note: When an ordinary cassette recorder is used, it may not be possible to record data files even if no
problems are encountered in storing or reading programs with the SAVE and LOAD commands.
(Example 1)
The following program writes the numbers from 1 to 99 on cassette tape.
1 0
W O P E N
" D A T A "
2 0
F O R
X = 1
T O
9 9
3 0
P R I N T / T
X
4 0
N E X T
X
5 0
C L O S E
6 0
E N D
(Example 2)
The following program reads data from the data file prepared in Example 1 above. Before execut-
ing this program, be sure to rewind the cassette tape.
1 0
R O P E N
" D A T A "
2 0
F O R
X = 1
T O
9 9
3 0
I N P U T / T
A
4 0
P R I N T
A
5 0
N E X T
X
6 0
C L O S E
7 0
E N D

Advertisement

Table of Contents
loading

Table of Contents