Vtech PreComputer Power Pad Plus User Manual - Page 68

Print A;b;d

Page 68 highlights

RESTORE If you want to use the same data later on in the program, you can do so by using the RESTORE statement. Example: 10 DATA 1,3,8,9 20 READ A,B,D 30 RESTORE 40 READ X,Y 50 PRINT A;B;D 60 PRINT X;Y 70 END RUN 13 8 1 3 The RESTORE command makes subsequent READ statements get their values from the start of the first DATA statement. Example: 10 REM FIND AVERAGE 20 DATA 0.125,3,0.6,7 30 DATA 23,9.3,25.2,8 40 S=0 50 FOR I=1 TO 8 60 READ N 70 S=S+N 80 NEXT 90 A=S/8 100 PRINT A RUN 9.52813 64

  • 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

64
RESTORE
If you want to use the same data later on in the program, you can do so by using the
RESTORE
statement.
Example:
10
DATA 1,3,8,9
20
READ A,B,D
30
RESTORE
40
READ X,Y
50
PRINT A;B;D
60
PRINT X;Y
70
END
RUN
1
3
8
1
3
The
RESTORE
command makes subsequent
READ
statements get their values from the
start of the first
DATA
statement.
Example:
10
REM FIND AVERAGE
20
DATA 0.125,3,0.6,7
30
DATA 23,9.3,25.2,8
40
S=0
50
FOR I=1 TO 8
60
READ N
70
S=S+N
80
NEXT
90
A=S/8
100
PRINT A
RUN
9.52813