Page images
PDF
EPUB

390 PRINT

400 PRINT "END PROGRAM 72" 410 END

PROGRAM FILE 72: EXCEPTION

SUBSCRIPT TOO SMALL FOR
TWO-DIMENSIONAL ARRAY, WITH DIM AND OPTION BASE 1.
ANSI STANDARD 6.5, 15.2, 15.4

[merged small][ocr errors][merged small]

TWO-DIMENSIONAL ARRAY, WITH DIM AND OPTION BASE 1.

THE OBJECT OF THIS TEST IS TO SEE WHETHER THE PROCESSOR
RECOGNIZES USE OF A ZERO SUBSCRIPT AS A FATAL EXCEPTION WHEN
OPTION BASE 1 HAS BEEN SPECIFIED ALONG WITH A
TWO-DIMENSIONAL ARRAY SET UP WITH A DIM-STATEMENT.

TO PASS THIS TEST:

1) A MESSAGE IDENTIFYING THE EXCEPTION MUST BE DISPLAYED, AND

2) THE PROGRAM MUST TERMINATE UPON USE OF THE ZERO SUBSCRIPT.

BEGIN TEST.

ABOUT TO ASSIGN TO B(12, 4). ASSIGNMENT SHOULD BE OK.
HAVE ASSIGNED 6 TO B(12, 4).

ABOUT TO ASSIGN TO B(12, 3). ASSIGNMENT SHOULD BE OK.
HAVE ASSIGNED 7 TO B(12, 3 ).

ABOUT TO ASSIGN TO B(12, 2). ASSIGNMENT SHOULD BE OK.
HAVE ASSIGNED 8 TO B(12, 2 ).

ABOUT TO ASSIGN TO B(12, 1 ). ASSIGNMENT SHOULD BE OK.
HAVE ASSIGNED 9 TO B(12, 1).

ABOUT TO ASSIGN TO B(12, 0 ).*** EXCEPTION SHOULD OCCUR NOW ***

[blocks in formation]

50 PRINT "*** NOTE: THIS PROGRAM MAKES USE OF THE INPUT STATEMENT"

60 PRINT "

70 PRINT "

80 PRINT " 90 PRINT

WHICH HAS NOT YET BEEN TESTED. IF SUBSEQUENT TESTS SHOW"
THIS FEATURE TO BE INCORRECTLY IMPLEMENTED, THEN THE "
VALIDITY OF THE RESULTS OF THIS TEST ROUTINE IS DOUBTFUL."

100 PRINT "SECTION 73.1: ERROR 110 PRINT "

120 PRINT

DIM SETS UPPER BOUND OF ZERO WITH"

OPTION BASE 1."

130 PRINT "THIS IS A TEST FOR A NON-STANDARD FEATURE OF MINIMAL BASIC." 140 PRINT "TO PASS THIS TEST, THE PROCESSOR MUST EITHER:"

150 PRINT

160 PRINT " 1) ACCEPT THE PROGRAM AND BE ACCOMPANIED BY DOCUMENTATION"
170 PRINT "
ACCURATELY DESCRIBING THE FEATURE'S INTERPRETATION"
BY THE PROCESSOR, OR"

180 PRINT " 190 PRINT

200 PRINT " 2) REJECT THE PROGRAM WITH AN APPROPRIATE ERROR MESSAGE" 210 PRINT

220 PRINT "SEE THE NBS MINIMAL BASIC TEST PROGRAMS USER'S MANUAL" 230 PRINT "FOR DETAILED CRITERIA."

240 PRINT

[blocks in formation]

300 PRINT "TO HELP IN CHECKING INTERPRETATION, YOU MAY ENTER"

310 PRINT "VALUES TO BE USED AS SUBSCRIPTS ON THE ARRAY. THE PROGRAM"
320 PRINT "WILL ASSIGN THE VALUE 777 TO THE INDICATED ELEMENT AND"
330 PRINT "THEN ECHO THE RESULT. IN THIS WAY YOU CAN CHECK WHICH"
340 PRINT "SUBSCRIPTS (0 OR 1) ARE WITHIN THE ARRAY AND WHICH CAUSE"
350 PRINT "EXCEPTIONS. ENTER 100 WHEN YOU WISH TO STOP."

360 PRINT

370 PRINT "ENTER VALUE TO BE USED AS SUBSCRIPT"

[blocks in formation]

10 PRINT "PROGRAM FILE 74: ERROR

13 PRINT "

16 PRINT "

20 PRINT"

30 PRINT

DIM SETS ARRAY TO ONE DIMENSION"
AND REFERENCE IS MADE TO TWO-DIMENSIONAL"
VARIABLE OF SAME NAME."
ANSI STANDARD 15.4, 6.4′′

40 PRINT "SECTION 74.1: ERROR

50 PRINT "

60 PRINT "

DIM SETS ARRAY TO ONE DIMENSION "
AND REFERENCE IS MADE TO TWO-DIMENSIONAL"
VARIABLE OF SAME NAME."

70 PRINT

80 PRINT

90 PRINT "THIS IS A TEST FOR A NON-STANDARD FEATURE OF MINIMAL BASIC." 100 PRINT "TO PASS THIS TEST, THE PROCESSOR MUST EITHER:"

110 PRINT

120 PRINT " 1) ACCEPT THE PROGRAM AND BE ACCOMPANIED BY DOCUMENTATION" 130 PRINT " ACCURATELY DESCRIBING THE FEATURE'S INTERPRETATION" BY THE PROCESSOR, OR"

140 PRINT " 150 PRINT

160 PRINT " 2) REJECT THE PROGRAM WITH AN APPROPRIATE ERROR MESSAGE" 170 PRINT

180 PRINT "SEE THE NBS MINIMAL BASIC TEST PROGRAMS USER'S MANUAL" 190 PRINT "FOR DETAILED CRITERIA."

[blocks in formation]

300 PRINT "VARIABLE A(I, J) WAS ASSIGNED 10000+(100*I)+J."

310 PRINT "RESULTS BELOW:"

320 PRINT

330 PRINT "ARRAY VALUES FOR A(I, J):"

340 PRINT "EACH LINE HAS ALL THE ELEMENTS FOR A GIVEN VALUE OF I," 350 PRINT "WITH J GOING FROM 0 TO 10."

[blocks in formation]

? ARRAY REFERENCE INCOMPATIBLE WITH PREVIOUS DIM IN LINE 260

? ARRAY REFERENCE INCOMPATIBLE WITH PREVIOUS DIM IN LINE 400

[blocks in formation]

40 PRINT "SECTION 75.1: ERROR - DIM SETS ARRAY TO ONE DIMENSION"
50 PRINT "
AND REFERENCE IS MADE TO SIMPLE VARIABLE"

[blocks in formation]
[ocr errors][merged small]

80 PRINT

90 PRINT "THIS IS A TEST FOR A NON-STANDARD FEATURE OF MINIMAL BASIC." 100 PRINT "TO PASS THIS TEST, THE PROCESSOR MUST EITHER:"

110 PRINT

120 PRINT " 1) ACCEPT THE PROGRAM AND BE ACCOMPANIED BY DOCUMENTATION"
130 PRINT "
ACCURATELY DESCRIBING THE FEATURE'S INTERPRETATION"
BY THE PROCESSOR, OR"

140 PRINT "

150 PRINT

160 PRINT " 2) REJECT THE PROGRAM WITH AN APPROPRIATE ERROR MESSAGE" 170 PRINT

180 PRINT "SEE THE NBS MINIMAL BASIC TEST PROGRAMS USER'S MANUAL" 190 PRINT "FOR DETAILED CRITERIA."

[blocks in formation]

300 PRINT "VARIABLE A WAS ASSIGNED 777. RESULTS BELOW:"

[blocks in formation]

? VARIABLE REFERENCE INCOMPATIBLE WITH PREVIOUS DIM IN LINE 240

**

10 PRINT "PROGRAM FILE 76: ERROR

13 PRINT "

16 PRINT "

DIM SETS ARRAY TO TWO DIMENSIONS"
AND REFERENCE IS MADE TO ONE-DIMENSIONAL"
VARIABLE OF SAME NAME."

[blocks in formation]

40 PRINT "SECTION 76.1: ERROR

50 PRINT "

60 PRINT "

DIM SETS ARRAY TO TWO DIMENSIONS"
AND REFERENCE IS MADE TO ONE-DIMENSIONAL"

VARIABLE OF SAME NAME."

70 PRINT

80 PRINT

90 PRINT "THIS IS A TEST FOR A NON-STANDARD FEATURE OF MINIMAL BASIC." 100 PRINT "TO PASS THIS TEST, THE PROCESSOR MUST EITHER:"

110 PRINT

120 PRINT " 1) ACCEPT THE PROGRAM AND BE ACCOMPANIED BY DOCUMENTATION" 130 PRINT " ACCURATELY DESCRIBING THE FEATURE'S INTERPRETATION" BY THE PROCESSOR, OR"

140 PRINT "

150 PRINT

160 PRINT " 2) REJECT THE PROGRAM WITH AN APPROPRIATE ERROR MESSAGE" 170 PRINT

180 PRINT "SEE THE NBS MINIMAL BASIC TEST PROGRAMS USER'S MANUAL" 190 PRINT "FOR DETAILED CRITERIA."

[blocks in formation]

280 PRINT "VARIABLE A(I) WAS ASSIGNED 111*I + 5000."

[blocks in formation]

? ARRAY REFERENCE INCOMPATIBLE WITH PREVIOUS DIM IN LINE 250

? ARRAY REFERENCE INCOMPATIBLE WITH PREVIOUS DIM IN LINE 320

黃黃黃黃

10 PRINT "PROGRAM FILE 77: ERROR REFERENCE TO ARRAY AND SIMPLE "

[blocks in formation]

80 PRINT "THIS IS A TEST FOR A NON-STANDARD FEATURE OF MINIMAL BASIC." 90 PRINT "TO PASS THIS TEST, THE PROCESSOR MUST EITHER:"

100 PRINT

« PreviousContinue »