10 REM 'ERR' TEST PROGRAM
20 DIM A(5)
30 CLEAR
40 ON ERROR GOTO 100
50 PRINT "ENTER A SAMPLE NUMBER";
60 INPUT N
61 IF N = -999 THEN 999
62 IF N = 0 THEN ERROR 11, "DIVISION BY ZERO"
63 IF N < 1 THEN ERROR 9 , "SUBSCRIPT OUT OF RANGE"
64 IF N > 5 THEN ERROR 9 , "SUBSCRIPT OUT OF RANGE"
70 A(N)=10/N
80 PRINT "THE NUMBER";N;"DID NOT CAUSE AN ERROR"
90 GOTO 50
100 IF ERR=9  THEN 130
110 IF ERR=11 THEN 160
120 GOTO 180
130 PRINT "THE NUMBER";N;"IS TOO LARGE"
140 PRINT "USE A NUMBER BETWEEN 1 AND 5"
150 RESUME 30
160 PRINT "THE SMALLEST NUMBER ALLOWED IS 1"
170 RESUME 30
180 PRINT "THE NUMBER";N;"CAUSED AN ERROR CODE OF";ERR
999 END
