10 PRINT "PROGRAM FILE 47: INCREMENT IN THE STEP CLAUSE OF THE"
20 PRINT "        FOR-STATEMENT DEFAULTS TO A VALUE OF ONE."
30 PRINT "    ANSI STANDARD 11.2, 11.4"
40 PRINT
50 PRINT "SECTION 47.1: INCREMENT IN THE STEP CLAUSE OF THE"
60 PRINT "        FOR-STATEMENT DEFAULTS TO A VALUE OF ONE."
70 PRINT
80 REM S1 IS ERROR SWITCH
90 LET S1=0
110 PRINT "               BEGIN TEST."
120 LET A1=8
130 LET B1=5
150 LET T2=0
160 GOSUB 3000
170 LET A1=5
180 LET B1=8
190 LET T2=4
200 GOSUB 3000
210 LET A1=88
220 LET B1=88
230 LET T2=1
240 GOSUB 3000
1000 IF S1=0 THEN 1030
1010 PRINT "*** TEST FAILED  ***"
1020 GOTO 1040
1030 PRINT "*** TEST PASSED ***"
1040 PRINT
1050 PRINT "               END TEST."
1060 PRINT
1070 PRINT "END PROGRAM 47"
1080 STOP
3000 REM SUBROUTINE TO TEST VARIOUS LOOPS
3002 PRINT
3004 PRINT "LOOP IS: FOR I1=";A1;" TO ";B1
3006 PRINT
3010 PRINT "CONTROL VARIABLE:"
3020 PRINT "SHOULD BE","ACTUAL","RESULT"
3030 LET I2=A1
3090 REM T1 IS LOOP COUNT
3100 LET T1=0
3110 FOR I1=A1 TO B1
3120    LET T1=T1+1
3130    GOSUB 6000
3140    LET I2=I2+1
3150 NEXT I1
3160 PRINT "LOOP EXITED"
3170 GOSUB 6000
3180 LET M$="  OK  "
3190 IF T1=T2 THEN 3220
3200 LET M$="FAILED"
3210 LET S1=1
3220 PRINT
3230 PRINT "NO. TIMES THROUGH LOOP:"
3240 PRINT "SHOULD BE: ";T2;"     ACTUAL: ";T1;"   RESULT: ";M$
3250 PRINT
3260 PRINT "----------------------------"
3270 PRINT
3280 RETURN
6000 REM SUBROUTINE TO CHECK THAT I1=I2
6010 LET M$="  OK  "
6020 IF I1=I2 THEN 6050
6030 LET M$="FAILED"
6040 LET S1=1
6050 PRINT I2,I1,M$
6060 RETURN
6070 END
