10 PRINT "PROGRAM FILE 108: INPUT TO SUBSCRIPTED VARIABLES."
20 PRINT "    ANSI STANDARD 13.2, 13.4"
30 PRINT
40 PRINT "SECTION 108.1: SIMPLE INPUT TO FILL ARRAY."
50 PRINT
60 PRINT "              BEGIN TEST."
70 PRINT
80 DATA 7,3,2,1,5,9,10,0,6,4,8
90 DATA 7,3,2,1,9,4,8,0,10,5,6
100 FOR I=0 TO 10
110 READ J
120 PRINT "PLEASE ENTER:";I
130 INPUT A(J)
140 NEXT I
150 FOR I=0 TO 10
160 READ T(I)
170 NEXT I
180 GOSUB 3000
190 PRINT "              END TEST."
200 PRINT
210 PRINT
220 PRINT "SECTION 108.2: INPUT OF SUBSCRIPT FOLLOWED BY SUBSCRIPTED"
230 PRINT "        VARIABLE."
240 PRINT
250 PRINT "             BEGIN TEST."
260 PRINT
270 PRINT "FOR THIS REPLY, STATEMENT IS: INPUT A(I),I,A(I),I,A(I)"
280 PRINT "PLEASE ENTER 500,6,600,2,200"
290 FOR I=0 TO 10
300 LET A(I)=10+I
310 LET T(I)=A(I)
320 NEXT I
330 LET I=5
340 INPUT A(I),I,A(I),I,A(I)
350 LET T(5)=500
360 LET T(6)=600
370 LET T(2)=200
380 GOSUB 3000
390 PRINT "               END TEST."
400 PRINT
410 PRINT
420 PRINT "SECTION 108.3: NO ASSIGNMENT BEFORE VALIDATION OF INPUT."
430 PRINT
440 PRINT "                BEGIN TEST"
450 PRINT
460 PRINT "THIS SECTION TESTS THAT NO ASSIGNMENT IS DONE BEFORE"
470 PRINT "THE ENTIRE REPLY IS VALIDATED."
480 FOR I=0 TO 10
490 LET A(I)=I*100
500 LET T(I)=A(I)
510 NEXT I
520 LET T(1)=8
530 PRINT
540 PRINT "PLEASE ENTER LINE NO. 1 FIRST. IT SHOULD BE REJECTED"
550 PRINT "BECAUSE OF INSUFFICIENT DATA AND YOU SHOULD BE ALLOWED"
560 PRINT "TO RE-SUPPLY INPUT. THEN ENTER LINE NO. 2 (NOTE THE SECOND"
570 PRINT "CHARACTER IS A COMMA RATHER THAN A PERIOD)."
580 PRINT
590 PRINT "*** IF NOT ALLOWED TO RE-SUPPLY INPUT, TEST FAILS ***"
600 PRINT
610 PRINT "THE ASSOCIATED INPUT STATEMENT IS: INPUT H,I,J,A(I),K,L"
620 PRINT "THEREFORE, AN 8 SHOULD BE PUT INTO A(1), AND NO OTHER"
630 PRINT "CHANGE MADE TO THE ARRAY."
640 PRINT
650 PRINT "LINE NO. 1:    3.1,6,8,9,11"
660 PRINT "LINE NO. 2:    3,1,6,8,9,11"
670 INPUT H,I,J,A(I),K,L
680 GOSUB 3000
690 PRINT "                END TEST"
700 PRINT
710 PRINT "SECTION 108.4: INPUT TO TWO-DIMENSIONAL ARRAY."
720 PRINT
730 FOR I=1 TO 5
740 FOR J=1 TO 3
750 LET X(I,J)=1000*I+J
760 NEXT J
770 NEXT I
780 PRINT "                 BEGIN TEST"
790 PRINT
800 PRINT "STATEMENT FOR THIS REPLY: INPUT I,J,X(I,J)"
810 PRINT "PLEASE ENTER 2,3,999"
820 LET E=0
830 INPUT I,J,X(I,J)
840 PRINT
850 PRINT "X(I,J)","J=1","J=2","J=3"
860 FOR I=1 TO 5
870 PRINT "I=";I,X(I,1),X(I,2),X(I,3)
880 FOR J=1 TO 3
890 IF I<>2 THEN 920
900 IF J<>3 THEN 920
910 GOTO 940
920 IF X(I,J)= 1000*I+J THEN 940
930 LET E=1
940 NEXT J
950 NEXT I
960 IF X(2,3)=999 THEN 980
970 LET E=1
980 PRINT
990 IF E=0 THEN 1040
1000 PRINT "***  TEST FAILED  ***"
1010 PRINT "EITHER X(2,3) <> 999 OR SOME OTHER "
1020 PRINT "X(I,j) <> 1000*I + J AS INITIALIZED."
1030 GOTO 1050
1040 PRINT "***  TEST PASSED  ***"
1050 PRINT
1060 PRINT "                  END TEST"
1070 PRINT
1080 PRINT "END PROGRAM 108"
1090 STOP
3000 REM SUBROUTINE TO CHECK THAT A(I)=T(I)
3010 LET F=0
3020 PRINT
3025 PRINT " ","  CONTENTS OF ARRAY"
3030 PRINT "SUBSCRIPT","SHOULD BE","ACTUAL"
3040 FOR I=0 TO 10
3050 IF A(I)=T(I) THEN 3070
3060 LET F=F+1
3070 PRINT I,T(I),A(I)
3080 NEXT I
3090 PRINT
3100 IF F=0 THEN 3130
3110 PRINT "***  TEST FAILED IN ";F;"CASE(S)  ***"
3120 GOTO 3140
3130 PRINT "***  TEST PASSED  ***"
3140 PRINT
3150 RETURN
3160 END
