5 PRINT "PROGRAM FILE 112: EXCEPTION - INPUT-REPLY INCONSISTENT WITH"
7 PRINT "        INPUT VARIABLE-LIST."
10 PRINT "    ANSI STANDARD 13.4, 13.5, 3.2, 5.2"
20 PRINT
25 PRINT "SECTION 112.1: EXCEPTION - INPUT-REPLY INCONSISTENT WITH"
27 PRINT "        INPUT VARIABLE-LIST."
30 PRINT
35 PRINT "PLEASE ENTER YOUR INPUT-REPLIES EXACTLY AS REQUESTED"
40 PRINT "BY THE PROMPT, INCLUDING ALL SPACING, COMMAS AND OTHER"
45 PRINT "PUNCTUATION."
50 PRINT
55 PRINT " - EXCEPT - WHEREVER THE PROMPT CONTAINS AN EQUALS (=)"
60 PRINT "SUBSTITUTE A BLANK SPACE, AND WHEREVER THE PROMPT"
65 PRINT "CONTAINS THE NUMBER-SIGN (#) SUBSTITUTE A QUOTE."
70 PRINT "THUS, THE PROMPT:"
75 PRINT "             ==#ER#=="
80 PRINT "SHOULD CAUSE YOU TO STRIKE THE KEYS:"
85 PRINT "  1. SPACE"
90 PRINT "  2. SPACE"
95 PRINT "  3. QUOTE"
100 PRINT "  4. LETTER E"
105 PRINT "  5. LETTER R"
110 PRINT "  6. QUOTE"
115 PRINT "  7. SPACE"
120 PRINT "  8. SPACE"
125 PRINT
130 PRINT "THESE CONVENTIONS ARE NECESSARY BECAUSE THE QUOTE IS"
135 PRINT "UNPRINTABLE IN MINIMAL BASIC, AND SPACES ARE DIFFICULT"
140 PRINT "TO COUNT ON A TERMINAL."
145 PRINT
150 PRINT "AFTER ENTERING THE REQUESTED REPLY, THE PROCESSOR SHOULD"
155 PRINT "REPORT AN EXCEPTION OF THE KIND INDICATED IN THE PROMPT."
160 PRINT "(ALTHOUGH SOME RESPONSES MAY VALIDLY CAUSE ONE OF SEVERAL"
165 PRINT "DIFFERENT KINDS OF EXCEPTION TO BE REPORTED BY THE SYSTEM.)"
170 PRINT
175 PRINT "YOU SHOULD THEN BE GIVEN A CHANCE TO RE-SUPPLY INPUT AND"
185 PRINT "SHOULD REPLY WITH AS MANY ZEROS AS INDICATED IN THE PROMPT."
190 PRINT "(E.G., FOR 3 ITEMS, RESPOND: 0,0,0 TO BYPASS EXCEPTION.)"
192 PRINT
193 PRINT "*** IF NOT ALLOWED TO RE-SUPPLY INPUT, TEST FAILS ***"
194 PRINT
195 PRINT "IF THE PROCESSOR ACCEPTS AN INPUT-REPLY, IT FAILS THE"
200 PRINT "TEST UNLESS 1) IT HAS A DOCUMENTED ENHANCED DEFINITION OF"
205 PRINT "NUMERIC-CONSTANT, UNQUOTED-STRING, QUOTED-STRING, OR"
210 PRINT "INPUT-REPLY SUCH AS TO RENDER MEANINGFUL A PARTICULAR"
215 PRINT "NON-STANDARD RESPONSE, OR 2) ITS DOCUMENTED IMPLEMENTATION-"
217 PRINT "DEFINED LIMITS FOR OVERFLOW (STRING OR NUMERIC) EXCEED"
218 PRINT "THE MINIMUM LIMITS ESTABLISHED BY THE STANDARD."
220 PRINT "NOT ALL THE INPUT-REPLIES ARE NON-STANDARD, BUT THEY"
225 PRINT "SHOULD ALL CAUSE EXCEPTIONS, SAVE AS NOTED ABOVE."
230 PRINT
235 PRINT "FOR USER CONVENIENCE, THE STRING TO BE ENTERED IS INDENTED"
240 PRINT "TWO SPACES, SO THAT IF THE INPUT-PROMPT OCCUPIES TWO"
245 PRINT "POSITIONS, AS RECOMMENDED, YOUR INPUT-REPLY WILL BE"
250 PRINT "ALIGNED WITH THE PROMPT STRING."
255 PRINT
260 PRINT "                 BEGIN TEST"
265 LET F=0
270 READ M,C(1),C(2),C(3),O,P$
275 LET Q$=""
280 LET R$=""
285 IF M<100 THEN 300
290 LET M=M-100
295 READ Q$,R$
300 IF M=0 THEN 2000
304 LET Q=0
308 FOR I2=1 TO M
312 LET Q=Q+Q+C(I2)
316 NEXT I2
320 LET Q=Q+1
324 IF M<=1 THEN 340
328 LET Q=Q+2
332 IF M<=2 THEN 340
336 LET Q=Q+4
340 LET Q1=Q
350 LET A1=1
355 LET B1=1
360 LET C1=1
365 LET A$="1"
370 LET B$="1"
375 LET C$="1"
380 PRINT
385 PRINT
390 PRINT "STATEMENT FOR THIS INPUT-REPLY: INPUT ";
395 IF C(1)=0 THEN 410
400 PRINT "A$";
405 GOTO 415
410 PRINT "A1";
415 IF M<=1 THEN 490
420 IF C(2)=0 THEN 435
425 PRINT ",B$";
430 GOTO 440
435 PRINT ",B1";
440 IF M<=2 THEN 490
445 IF C(3)=0 THEN 460
450 PRINT ",C$";
455 GOTO 490
460 PRINT ",C1";
490 PRINT
500 PRINT "EXCEPTION: ";
505 ON O GOTO 510,520,530,540,550
510 PRINT "WRONG TYPE";
515 GOTO 560
520 PRINT "TOO MUCH DATA";
525 GOTO 560
530 PRINT "INSUFFICIENT DATA";
535 GOTO 560
540 PRINT "NUMERIC OVERFLOW";
545 GOTO 560
550 PRINT "STRING OVERFLOW";
555 GOTO 560
560 PRINT "; SHOULD BE ";M;" ITEM(S)."
565 PRINT "PLEASE ENTER:"
570 PRINT "  ";P$;Q$;R$
580 ON Q1 GOTO 585,595,605,615,625,635,645,655,665,675,685,695,705,715
585 INPUT A1
590 GOTO 725
595 INPUT A$
600 GOTO 725
605 INPUT A1,B1
610 GOTO 725
615 INPUT A1,B$
620 GOTO 725
625 INPUT A$,B1
630 GOTO 725
635 INPUT A$,B$
640 GOTO 725
645 INPUT A1,B1,C1
650 GOTO 725
655 INPUT A1,B1,C$
660 GOTO 725
665 INPUT A1,B$,C1
670 GOTO 725
675 INPUT A1,B$,C$
680 GOTO 725
685 INPUT A$,B1,C1
690 GOTO 725
695 INPUT A$,B1,C$
700 GOTO 725
705 INPUT A$,B$,C1
710 GOTO 725
715 INPUT A$,B$,C$
720 GOTO 725
725 REM RESULTS DISPLAYED
728 REM Y2 IS ERROR SWITCH, Y IS ITEM COUNT.
730 LET Y2=0
735 LET Y=1
740 LET Y1=A1
745 LET Z$=A$
750 GOSUB 1000
755 IF M<=1 THEN 795
760 LET Y1=B1
765 LET Z$=B$
770 GOSUB 1000
775 IF M<=2 THEN 795
780 LET Y1=C1
785 LET Z$=C$
790 GOSUB 1000
795 IF Y2<>0 THEN 810
800 PRINT "TEST OK."
805 GOTO 270
810 PRINT "NOT ALL VARIABLES EQUAL TO ZERO."
820 PRINT "POSSIBILITIES:"
825 PRINT "1 - PROCESSOR FAILED TO TREAT REPLY AS EXCEPTION"
835 PRINT "2 - USER REPLY TO BYPASS EXCEPTION NOT ALL ZEROS"
840 PRINT "3 - PROCESSOR DID NOT ALLOW RE-ENTRY OF INPUT-REPLY."
845 PRINT "RE-TRY (Y OR N)?"
850 INPUT W$
855 IF W$<>"N" THEN 350
860 PRINT "TEST FAILS, UNLESS DOCUMENTED SYNTACTIC ENHANCEMENT."
865 LET F=F+1
870 GOTO 270
1000 REM SUBROUTINE TO CHECK AND DISPLAY ONE ITEM
1002 PRINT "ITEM#";Y;":";
1005 IF C(Y)=0 THEN 1025
1010 PRINT Z$
1015 IF Z$="0" THEN 1040
1020 GOTO 1035
1025 PRINT Y1
1030 IF Y1=0 THEN 1040
1035 LET Y2=9
1040 LET Y=Y+1
1045 RETURN
2000 PRINT
2010 IF F=0 THEN 2040
2020 PRINT "***  POSSIBLE TEST FAILURE IN ";F;" CASE(S).  ***"
2030 GOTO 2050
2040 PRINT "***  TEST PASSED  ***"
2050 PRINT
2060 PRINT "            END TEST"
2070 PRINT
2080 PRINT "END PROGRAM 112"
3000 REM  1     -    #ITEMS(+100 IF LONG PROMPT),
3010 REM  2-4   -    3-DIGIT A/N CODE (0=>N, 1=>A)
3020 REM  5     -    EXCP CODE
3030 REM  6(-8) -    PROMPT (3 STRINGS IF LONG)
3040 DATA 3,1,1,1,2,"M,M,M,M"
3050 DATA 3,1,1,1,3,"M,M"
3060 DATA 1,0,0,0,4,"1E99999"
3070 DATA 101,1,1,1,5,"IF=THIS=DOES=NOT=C","AUSE=STRING=OVRFLW"
3080 DATA         "=TRY=LONGER=REPLY"
3090 DATA 1,1,1,1,1,"AB?CD"
3100 DATA 1,1,1,1,1,"AB;CD"
3110 DATA 1,1,1,1,1,"K*L"
3120 DATA 3,0,0,0,1,"1,Q,1"
3125 DATA 1,0,0,0,1,"1D1"
3130 DATA 1,1,1,1,1,"AB##CD"
3140 DATA 1,1,1,1,1,"AB#CD"
3150 DATA 1,1,1,1,1,"#AB"
3160 DATA 1,1,1,1,1,"AB#"
3170 DATA 1,1,1,1,1,"#AB##CD#"
3180 DATA 1,1,1,1,1,"#AB#CD#"
3190 DATA 2,1,1,1,1,"AB#CD,EF"
3200 DATA 2,1,1,1,1,"AB,CD#EF"
3210 DATA 2,1,1,1,1,"A#B,C#D"
3220 DATA 3,1,1,1,1,"A,,B"
3230 DATA 2,1,1,1,2,"X,Y,"
3240 DATA 3,1,1,1,1,"X,Y,"
3250 DATA 3,1,1,1,1,",A,B"
3260 DATA 101,1,1,1,1,"     NULL REPLY ","(HIT RETURN ONLY)",""
3270 DATA 2,0,0,0,1,"2==3"
3280 DATA 1,0,0,0,1,"2==3"
3290 DATA 3,1,1,1,1,"X,===,Y"
4000 DATA 0,0,0,0,0,"Q"
4010 END
