Sharp OZ-707 Operation Manual - Page 109

Data, Read

Page 109 highlights

EXAMPLE: 10: INPUT "CONTINUE";A$ 20: IF A$ = ·YES· THEN 10 30: IF A$ = "NO" THEN 60 " 40: PRINT "ENTER YES OR NO PLEASE! 50: GOTO 10 60: END RENUM 100, 10, 5 IEJrnR I 100: INPUT "CONTINUE";A$ 105: IF A$ = "YES" THEN 100 110· IF A$ = "NO" THEN 125 115~ PRINT "ENTER YES OR NO PLEASE!" 120: GOTO 100 125: END 206 RESTORE p FORMAT: 1 RESTORE {line number} . *Iabel 2. RESTORE Abbreviation: RES. See Also: DATA, READ PURPOSE: Rereads values in a DATA statement or changes the order in which these values are read. REMARKS: In the regular use of READ, reading begins with the first value in a DATA statement and proceeds sequentially through the remaining values. Format 1 resets the pointer to the first value of the DATA statement whose line number is equal to the specified line number or *Iabel. Format 2 resets the pointer to the first value of the first DATA statement, so that it can be read again. EXAMPLE: 10: DIM 8(10) 20: WAIT 32 30: FOR I = 1 TO 10 40: RESTORE 50: READ 8(1) 60: PRINT 8(1)*1; 70: NEXT I 80: DATA 20 90: END [101 Sets up an array. [S01 Assigns the value 20 to each of the elements of B( ). 207

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128

EXAMPLE:
10:
INPUT "CONTINUE";A$
20:
IF A$
=
·YES·
THEN
10
30:
IF A$
=
"NO" THEN
60
"
40: PRINT "ENTER YES OR
NO
PLEASE!
50:
GOTO
10
60:
END
RENUM
100, 10, 5
I
EJrnR
I
100:
INPUT "CONTINUE";A$
105:
IF A$
=
"YES" THEN
100
110·
IF A$
=
"NO" THEN
125
115~
PRINT "ENTER YES OR NO PLEASE!"
120:
GOTO
100
125:
END
206
7
RESTORE
FORMAT:
1 RESTORE {line number}
.
*Iabel
2. RESTORE
Abbreviation:
RES.
See
Also:
DATA, READ
PURPOSE:
Rereads values in a DATA statement or changes the order
in
which
these values are read.
REMARKS:
In
the regular use of READ, reading begins with the first value in a
DATA statement and proceeds sequentially through the remaining
values. Format 1 resets the pointer to the first value of the DATA
statement whose line number is equal to the specified line number or
*Iabel. Format 2 resets the pointer to the first value of the first DATA
statement, so that it can be read again.
EXAMPLE:
10:
DIM
8(10)
20:
WAIT
32
30:
FOR
I
=
1
TO
10
40
: RESTORE
50:
READ
8(1)
60:
PRINT
8(1)*1;
70:
NEXT
I
80: DATA 20
90:
END
[101
Sets up
an
array.
[S01
Assigns the value 20 to each of the elements
of
B(
).
207
p