Music Control Statements; Graphic Control Statements; Cassette Data File Input/Output Statements - Sharp MZ-80A Owner's Manual

Hide thumbs Also See for MZ-80A:
Table of Contents

Advertisement

112
1.5.8 Music
control
statements
MUSIC
TEMPO
300 TEMPO
7
310 MUSIC "DE#FGA"
The MUSIC
statement
generates
a melody from the
speaker accord¬
ing
to the
melody
siring data
enclosed
in quotation
marks or
string
variables
at
the tempo specified by the
TEMPO
statement.
The TEMPO
statement
on
line number
300 specifies
tempo
7. The
MUSIC
statement
on line number 310
generates
a
melody consist¬
ing of
D, E,
F sharp.
G
and A. Each
note
is
a
quarter note.
When
the
TEMPO
statement is omitted,
default
tempo is set.
300
MIS
=
"C3EG
+
C"
310
M2$
=
"
+
E+C
+
E
+
G"
320
M3$
=
"+#B8R5
"
330 MUSIC
M1S.M2S.M3S
In
this example, the melody
is
divided
into
3 parts and substituted
in
3
string
variables. The following melody
is
generated from the
speaker
at tempo
4.
'i
1 .5.9 Graphic control
statements
SET
Sets
a
dot in the
specified
position
on
the
CRT screen.
The first operand specifies the X-coordinates (0-79) and
the
second
operand specifies the Y-coordinates (0-49).
300 SET
40.
25
Displays a dot in the center of the
screen.
RESET
Resets a
dot in the
specified
position
on
the
CRT screen.
310 RESET 40. 25
Resets
a dot from the center of the
screen.
1.5.
10 Cassette data file
input/output
statements
WOPEN/T
10
WOPEN/T
"DATA-1"
Defines the file
name
of a
cassette
data file
to
be
created as
"DATA-1"
and opens.
PRINT/T
20
PRINT/T
A.
AS
Writes the contents of variable A and
string
variable
AS
in order
in
the cassette
data file which
was opened by
a
WOPEN/T
state¬
ment.
CLOSE/T
30
CLOSE/T
Closes the cassette data file which was opened
by
a
WOPEN/T
statement.
ROPEN/T
110
ROPEN/T
"DATA-2"
Opens the
cassette
data file specified with file name
"DATA-2".
INPUT/T
120
INPUT/T
B. BS
Reads data sequentially from
the beginning of the cassette data file
which
was
opened
by
the
ROPEN/T
statement
and
substitutes
numerical data
into
variable B and
string
data
into string variable
BS
respectively.
CLOSE/T
130
CLOSE/T
Closes the cassette data file which was opened
by a
ROPEN/T
statement.

Advertisement

Table of Contents
loading

Table of Contents