Page images
PDF
EPUB
[blocks in formation]

PROGRAM FILE 69: EXCEPTION

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

SECTION 69.1: EXCEPTION SUBSCRIPT TOO LARGE FOR

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

THE OBJECT OF THIS TEST IS TO SEE WHETHER THE PROCESSOR
RECOGNIZES A FATAL EXCEPTION WHEN A SUBSCRIPT EXCEEDS
THE EXPLICIT UPPER BOUND OF AN ARRAY, WITH AN OPTION
STATEMENT PRESENT.

TO PASS THIS TEST:

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

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

BEGIN TEST.

ABOUT TO ASSIGN TO B(0, 9). ASSIGNMENT SHOULD BE OK.
HAVE ASSIGNED 11 TO B(0, 9 ).

ABOUT TO ASSIGN TO B(0, 10 ). ASSIGNMENT SHOULD BE OK.
HAVE ASSIGNED 10 TO B(0, 10 ).

ABOUT TO ASSIGN TO B(0, 11 ). ASSIGNMENT SHOULD BE OK.
HAVE ASSIGNED 9 TO B(0, 11 ).

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

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

? DIMENSION ERROR IN LINE 300

**** ****

10 PRINT "PROGRAM FILE 70: EXCEPTION SUBSCRIPT TOO SMALL FOR"
15 PRINT "
ONE-DIMENSIONAL ARRAY, WITH OPTION BASE 0."

20 PRINT " ANSI STANDARD 6.5, 15.2, 15.4"
30 PRINT

40 PRINT "SECTION 70.1: EXCEPTION 50 PRINT "

60 PRINT

SUBSCRIPT TOO SMALL FOR"
ONE-DIMENSIONAL ARRAY, WITH OPTION BASE 0."

70 PRINT "THE OBJECT OF THIS TEST IS TO SEE WHETHER THE PROCESSOR" 80 PRINT "RECOGNIZES USE OF A NEGATIVE SUBSCRIPT AS A FATAL EXCEPTION" 90 PRINT "WHEN OPTION BASE O HAS BEEN SPECIFIED."

100 PRINT

110 PRINT "TO PASS THIS TEST:"

120 PRINT

130 PRINT " 140 PRINT " 150 PRINT 160 PRINT "

170 PRINT "

180 PRINT

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

2) THE PROGRAM MUST TERMINATE UPON USE OF THE"
NEGATIVE SUBSCRIPT."

[blocks in formation]

310

320

330 NEXT I

340 PRINT

350 PRINT "

PRINT "ASSIGNMENT TO SUBSCRIPT < 0 *** TEST FAILS
PRINT

END TEST."

360 PRINT

370 PRINT "END PROGRAM 70" 380 END

PROGRAM FILE 70: EXCEPTION SUBSCRIPT TOO SMALL FOR

ONE-DIMENSIONAL ARRAY, WITH OPTION BASE 0.

ANSI STANDARD 6.5, 15.2, 15.4

SECTION 70.1: EXCEPTION SUBSCRIPT TOO SMALL FOR
ONE-DIMENSIONAL ARRAY, WITH OPTION BASE 0.

THE OBJECT OF THIS TEST IS TO SEE WHETHER THE PROCESSOR
RECOGNIZES USE OF A NEGATIVE SUBSCRIPT AS A FATAL EXCEPTION
WHEN OPTION BASE O HAS BEEN SPECIFIED.

TO PASS THIS TEST:

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

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

BEGIN TEST.

ABOUT TO ASSIGN TO A( 3 ). ASSIGNMENT SHOULD BE OK.
HAVE ASSIGNED 17
17 TO A 3).

ABOUT TO ASSIGN TO A( 2 ). ASSIGNMENT SHOULD BE OK.
HAVE ASSIGNED 18 TO A( 2 ).

ABOUT TO ASSIGN TO A( 1 ). ASSIGNMENT SHOULD BE OK.
HAVE ASSIGNED 19 TO A( 1 ).

ABOUT TO ASSIGN TO A( 0 ). ASSIGNMENT SHOULD BE OK.

HAVE ASSIGNED 20 TO A( 0 ).

ABOUT TO ASSIGN TO A(-1 ).*** EXCEPTION SHOULD OCCUR NOW ***

? DIMENSION ERROR IN LINE 280

10 PRINT "PROGRAM FILE 71: EXCEPTION

15 PRINT

[ocr errors]

SUBSCRIPT TOO SMALL FOR"
TWO-DIMENSIONAL ARRAY, WITH DIM AND OPTION BASE 0."

20 PRINT " ANSI STANDARD 6.5, 15.2, 15.4"

30 PRINT

40 PRINT "SECTION 71.1: EXCEPTION SUBSCRIPT TOO SMALL FOR" 50 PRINT "

70 PRINT

TWO-DIMENSIONAL ARRAY, WITH DIM AND OPTION BASE 0."

80 PRINT "THE OBJECT OF THIS TEST IS TO SEE WHETHER THE PROCESSOR" 90 PRINT "RECOGNIZES A FATAL EXCEPTION WHEN A SUBSCRIPT EXCEEDS" 100 PRINT "THE EXPLICIT LOWER BOUND OF AN ARRAY."

110 PRINT

120 PRINT "TO PASS THIS TEST:"

130 PRINT

140 PRINT "

150 PRINT " 160 PRINT

170 PRINT " 180 PRINT "1

190 PRINT

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

2) THE PROGRAM MUST TERMINATE UPON USE OF THE ILLEGAL"

SUBSCRIPT."

***

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

PROGRAM FILE 71: EXCEPTION SUBSCRIPT TOO SMALL FOR
TWO-DIMENSIONAL ARRAY, WITH DIM AND OPTION BASE 0.
ANSI STANDARD 6.5, 15.2, 15.4

SECTION 71.1: EXCEPTION

SUBSCRIPT TOO SMALL FOR

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

THE OBJECT OF THIS TEST IS TO SEE WHETHER THE PROCESSOR
RECOGNIZES A FATAL EXCEPTION WHEN A SUBSCRIPT EXCEEDS
THE EXPLICIT LOWER BOUND OF AN ARRAY.

TO PASS THIS TEST:

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

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

ABOUT TO ASSIGN TO B

BEGIN TEST.

3,3). ASSIGNMENT SHOULD BE OK.

HAVE ASSIGNED 17 TO B( 3,3).

ABOUT TO ASSIGN TO B( 2,3). ASSIGNMENT SHOULD BE OK.
HAVE ASSIGNED 18 TO B( 2,3).

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

ABOUT TO ASSIGN TO B( 0,3). ASSIGNMENT SHOULD BE OK.

HAVE ASSIGNED 20 TO B(0.3).

ABOUT TO ASSIGN TO B(-1,3).*** EXCEPTION SHOULD OCCUR NOW ***

? DIMENSION ERROR IN LINE 300

10 PRINT "PROGRAM FILE 72: EXCEPTION 15 PRINT "

SUBSCRIPT TOO SMALL FOR"
TWO-DIMENSIONAL ARRAY, WITH DIM AND OPTION BASE 1."

20 PRINT " ANSI STANDARD 6.5, 15.2, 15.4′′
30 PRINT

40 PRINT "SECTION 72.1: EXCEPTION

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

SUBSCRIPT TOO SMALL FOR"

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

80 PRINT "THE OBJECT OF THIS TEST IS TO SEE WHETHER THE PROCESSOR"

90 PRINT "RECOGNIZES USE OF A ZERO SUBSCRIPT AS A FATAL EXCEPTION WHEN" 100 PRINT "OPTION BASE 1 HAS BEEN SPECIFIED ALONG WITH A"

110 PRINT "TWO-DIMENSIONAL ARRAY SET UP WITH A DIM-STATEMENT." 120 PRINT

130 PRINT "TO PASS THIS TEST:"

140 PRINT

150 PRINT "

160 PRINT " 170 PRINT 180 PRINT " 190 PRINT "

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

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

200 PRINT

210 PRINT "

BEGIN TEST."

220 PRINT

230 OPTION BASE 1

240 DIM B(12,4)

250 FOR I=4 TO -2 STEP -1

260 PRINT "ABOUT TO ASSIGN TO B(12,";I;").";

PRINT "*** EXCEPTION SHOULD OCCUR NOW ***"

PRINT " ASSIGNMENT SHOULD BE OK."

PRINT "HAVE ASSIGNED ";10-I;" TO B(12,";I;")."

[blocks in formation]

280

290.

GOTO 310

300

310

LET B(12,I)=10-I

[blocks in formation]

PRINT "ASSIGNMENT TO SUBSCRIPT < 1 *** TEST FAILS ***"1

[ocr errors][merged small]
« PreviousContinue »