Sharp MZ-700 Series Owner's Manual page 47

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

Advertisement

(Example 3)
1 0
D I M
A ( 2 )
R E A D
A ( 0 ) ,
P R I N T
A ( 0 )
E N D
D A T A
20
3 0
4 0
5 0
RUN J
3
4
A ( 1 ) . A ( 2 )
; A ( 1 ) ; A ( 2 )
3 , 4 ,
5
(Example 4)
1 0
R E A D
2 0
R E A D
3 0
D A T A
A
B
X
•The READ statement in this program
substitutes the numeric values following
the DATA statement into array elements
A(0), A( 1), and A(2), then the PRINT
statement on line 30 displays the values
of those array elements.
The example above is incorrect because
(1) a numeric variable is specified by the
READ statement on line 10, but the value
specified following the DATA statement
is a string value, and (2) there is no data
which can be read by the READ statement
on line 20.
4 5

Advertisement

Table of Contents
loading

Table of Contents