10 PRINT "PROGRAM FILE 94: READING DATA INTO SUBSCRIPTED VARIABLES."
20 PRINT "    ANSI STANDARD 14.2, 14.4"
30 PRINT
40 PRINT "SECTION 94.1: READING DATA INTO SUBSCRIPTED VARIABLES."
50 PRINT
60 PRINT "THIS SECTION TESTS THAT THE NUMERIC DATA CAN BE READ INTO"
70 PRINT "ARRAYS AND THAT SUBSCRIPTS ARE EVALUATED AFTER READING"
80 PRINT "INTO PREVIOUS VARIABLES."
90 PRINT
100 PRINT "                  BEGIN TEST"
110 PRINT
120 REM ARRAYS A AND C ARE GIVEN DATA THROUGH THE DATA AND READ
130 REM AND COMPARED WITH B AND D WHICH ARE ASSIGNED THE RIGHT
140 REM VALUES. IF THE ARRAYS MATCH TEST PASSES.
150 FOR I=1 TO 5
160 LET A(I)=I
170 LET B(I)=I
180 FOR J=1 TO 3
190 LET C(I,J)=1000*I+J
200 LET D(I,J)=1000*I+J
210 NEXT J
220 NEXT I
230 LET J=2
240 READ I,A(I),I,A(I),I,C(I,J),J,I,C(I,J)
250 DATA 3,199,2,299,4,399,1,2,499
260 LET B(3)=199
270 LET B(2)=299
280 LET D(4,2)=399
290 LET D(2,1)=499
300 PRINT "VALUES FOR A(I)"
310 PRINT "I","A(I)","A(I)"
320 PRINT ,"SHOULD BE","ACTUAL"
330 LET M$="PASSED. ***"
340 FOR I=1 TO 5
350 LET S$=" "
360 IF A(I)=B(I) THEN 390
370 LET M$="FAILED. ***"
380 LET S$=" ***"
390 PRINT I,B(I),A(I),S$
400 NEXT I
410 PRINT
420 PRINT "*** TEST FOR ONE-DIMENSIONAL ARRAY ";M$
430 LET M$="PASSED. ***"
440 PRINT
450 PRINT "VALUES FOR C(I,J)"
460 PRINT "I=",,"J=1","J=2","J=3"
470 FOR I=1 TO 5
480 PRINT I,"SHOULD BE:",D(I,1),D(I,2),D(I,3)
490 PRINT ,"ACTUAL:",C(I,1),C(I,2),C(I,3)
500 PRINT ,,
510 FOR J=1 TO 3
520 IF C(I,J)=D(I,J) THEN 560
530 LET M$="FAILED. ***"
540 PRINT " ***",
550 GOTO 570
560 PRINT "   ",
570 NEXT J
580 PRINT
590 NEXT I
600 PRINT
610 PRINT "*** TEST FOR TWO-DIMENSIONAL ARRAY ";M$
620 PRINT
630 PRINT "                 END TEST"
640 PRINT
650 PRINT "END PROGRAM 94"
660 END
