Page images
PDF
EPUB
[blocks in formation]

*** TEST PASSED IF ACTUAL OUTPUT MATCHES OUTPUT AS IT SHOULD BE (ALLOWING FOR OPTIONAL TRAILING ZEROS IN THE SIGNIFICAND AND LEADING ZEROS IN THE EXRAD) ***

END TEST.

SECTION 14.2: ASSIGNING NR3 CONSTANTS OF SIX SIGNIFICANT DIGITS WHICH ARE NEAR THE MAGNITUDE OF: 1E+38 OR 1E-38.

[blocks in formation]

*** TEST PASSED IF ACTUAL OUTPUT MATCHES OUTPUT AS IT SHOULD BE (ALLOWING FOR OPTIONAL TRAILING ZEROS IN THE SIGNIFICAND AND LEADING ZEROS IN THE EXRAD) ***

END TEST.

SECTION 14.3: NR3 NUMERIC CONSTANTS AT EXTREME
MAGNITUDES AS PRINT ITEMS.

[blocks in formation]

*** TEST PASSED IF ACTUAL OUTPUT MATCHES OUTPUT AS IT SHOULD BE (ALLOWING FOR OPTIONAL TRAILING ZEROS IN THE SIGNIFICAND AND LEADING ZEROS IN THE EXRAD) ***

END TEST.

SECTION 14.4: NR3 NUMERIC VARIABLES AT EXTREME
MAGNITUDES AS PRINT ITEMS.

[blocks in formation]

*** TEST PASSED IF ACTUAL OUTPUT MATCHES OUTPUT AS IT SHOULD BE (ALLOWING FOR OPTIONAL TRAILING ZEROS IN THE SIGNIFICAND AND LEADING ZEROS IN THE EXRAD) ***

END PROGRAM 14

**

**

***

END TEST.

10 PRINT "PROGRAM FILE 15: THE REM AND GOTO STATEMENTS." 20 PRINT "

30 PRINT

ANSI STANDARD 18.2, 18.4, 10.2, 10.4"

BEGIN TEST."

THIS SECTION TESTS THE REM-STATEMENT. THE MINIMAL BASIC
CHARACTER SET OF ASCII CHARACTERS IS GIVEN BELOW.

40 PRINT "SECTION 15.1: THE REM-STATEMENT

FOR PROGRAM COMMENTS."

50 PRINT

60 PRINT "

80 REM

90 REM

100 REM

110 REM

120 REM

130 REM

ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789

! "#$%&'()*+,-./:;<=>?^

140 REM THE PROGRAM FLOW SHOULD NOT BE ALTERED BY REM STATEMENTS. 160 PRINT "*** REM TEST PASSED IF THESE ARE THE ONLY TWO LINES " 162 REM BETWEEN TWO PRINTS HAS NO EFFECT

165 PRINT " PRINTED BETWEEN 'BEGIN TEST.' AND 'END TEST.' ***11 170 REM NOR DOES A REM FOLLOWING LAST PRINT

180 PRINT "

190 PRINT

END TEST."

200 PRINT "SECTION 15.2: TEST OPTIONAL SPELLING OF GOTO AND TRANSFER TO"

210 PRINT "

220 PRINT

230 PRINT "

240 PRINT

REM-STATEMENT."

BEGIN TEST."

**

***** ****

250 PRINT "IF 1 FOLLOWS THIS LINE, TRANSFER USING 'GOTO' PERFORMED" 260 GOTO 430

270 PRINT "

280 LET M=3

ERROR: TRANSFER FROM LINE 260 TO 430 NOT PERFORMED"

290 PRINT TAB(67); M

300 PRINT "IF 4 FOLLOWS THIS LINE, TRANSFER TO REM-STATEMENT PERFORMED"

310 GO TO 600

320 PRINT "

330 LET M=7

ERROR: TRANSFER FROM LINE 310 TO 600 NOT PERFORMED"

340 PRINT TAB(67); M

350 PRINT "IF 8 FOLLOWS THESE TWO LINES, FORWARD TRANSFER PERFORMED," 355 PRINT " WITH LEADING ZERO IN LINE NUMBER OF THE GOTO"

360 GO TO 0480

370 PRINT "

380 LET M=2

ERROR: TRANSFER FROM LINE 360 TO 480 NOT PERFORMED"

390 PRINT TAB(67); M

400 PRINT "IF 3 FOLLOWS THIS LINE, TRANSFER USING 'GO TO' PERFORMED" 410 GO TO 280

420 PRINT "

430 LET M=1

ERROR: TRANSFER FROM LINE 410 TO 280 NOT PERFORMED"

440 PRINT TAB(67); M

450 PRINT "IF 2 FOLLOWS THIS LINE, TRANSFER USING 'GO TO' PERFORMED"

460 GO TO 380

470 PRINT "

480 LET M=8

ERROR: TRANSFER FROM LINE 460 TO 380 NOT PERFORMED"

490 PRINT TAB(67); M

495 PRINT

500 PRINT "THE NEXT OUTPUT MUST BE THE ** TEST PASSED...'" 510 PRINT "MESSAGE FOR TEST TO PASS."

515 PRINT

520 GO TO 710

530 PRINT "

540 LET M=6

ERROR: TRANSFER FROM LINE 520 TO 710 NOT PERFORMED"

550 PRINT TAB(67); M

560 PRINT "IF 7 FOLLOWS THIS LINE, BACKWARD TRANSFER PERFORMED"

570 GO TO 330

580 PRINT "

ERROR: TRANSFER FROM LINE 570 TO 330 NOT PERFORMED"

590 REM

600 REM TEST GOTO TRANSFERRING CONTROL TO REM STATEMENT. 610 LET M=4

620 PRINT TAB(67); M

630 PRINT "IF 5 FOLLOWS THIS LINE, FORWARD TRANSFER PERFORMED"

640 GO TO 660

650 PRINT "

660 LET M=5

ERROR: TRANSFER FROM LINE 640 TO 660 NOT PERFORMED"

670 PRINT TAB(67); M

680 PRINT "IF 6 FOLLOWS THIS LINE, BACKWARD TRANSFER PERFORMED"

690 GO TO 540

700 PRINT "

710 PRINT "***

720 PRINT "

730 PRINT

740 PRINT "

ERROR: TRANSFER FROM LINE 690 TO 540 NOT PERFORMED"
TEST PASSED IF THE OUTPUT ABOVE IS ORDERED 1,2..., 8
AND NO ERROR MESSAGES HAVE APPEARED ***"

END TEST."

11

760 PRINT

770 PRINT "SECTION 15.3: GOTO-STATEMENT TRANSFERS TO ANOTHER GOTO." 780 PRINT

790 PRINT "

800 PRINT

810 GO TO 880

820 PRINT

BEGIN TEST."

ERROR: TRANSFER FROM LINE 810 TO 880 NOT PERFORMED" 830 PRINT "*** TEST PASSED IF THERE ARE NO ERROR MESSAGES ***"

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

ERROR: TRANSFER FROM LINE 840 TO 900 NOT PERFORMED"

ERROR: TRANSFER FROM LINE 860 TO 830 NOT PERFORMED"

ERROR: TRANSFER FROM LINE 880 TO 860 NOT PERFORMED"

930 PRINT "END PROGRAM 15" 940 END

END TEST."

PROGRAM FILE 15: THE REM AND GOTO STATEMENTS.
ANSI STANDARD 18.2, 18.4, 10.2, 10.4

SECTION 15.1: THE REM-STATEMENT FOR PROGRAM COMMENTS.

BEGIN TEST.

*** REM TEST PASSED IF THESE ARE THE ONLY TWO LINES PRINTED BETWEEN 'BEGIN TEST.' AND 'END TEST.' ***

END TEST.

SECTION 15.2: TEST OPTIONAL SPELLING OF GOTO AND TRANSFER TO
REM-STATEMENT.

BEGIN TEST.

IF 1 FOLLOWS THIS LINE, TRANSFER USING 'GOTO' PERFORMED
IF 2 FOLLOWS THIS LINE, TRANSFER USING 'GO TO PERFORMED
IF 3 FOLLOWS THIS LINE, TRANSFER USING 'GO TO' PERFORMED
IF 4 FOLLOWS THIS LINE, TRANSFER TO REM-STATEMENT PERFORMED
IF 5 FOLLOWS THIS LINE, FORWARD TRANSFER PERFORMED
IF 6 FOLLOWS THIS LINE, BACKWARD TRANSFER PERFORMED
IF 7 FOLLOWS THIS LINE, BACKWARD TRANSFER PERFORMED

1

2

3

4

5

6

7

IF 8 FOLLOWS THESE TWO LINES, FORWARD TRANSFER PERFORMED,
WITH LEADING ZERO IN LINE NUMBER OF THE GOTO

8

THE NEXT OUTPUT MUST BE THE '*** TEST PASSED...
MESSAGE FOR TEST TO PASS.

*** TEST PASSED IF THE OUTPUT ABOVE IS ORDERED 1,2...,8 AND NO ERROR MESSAGES HAVE APPEARED ***

END TEST.

SECTION 15.3: GOTO-STATEMENT TRANSFERS TO ANOTHER GOTO.

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

10 PRINT "PROGRAM FILE 16: ERROR 15 PRINT "

TRANSFER TO A NON-EXISTING LINE"
NUMBER USING THE GOTO-STATEMENT."

20 PRINT " ANSI STANDARD 10.4" 30 PRINT

40 PRINT "SECTION 16.1: ERROR TRANSFER TO A NON-EXISTING LINE" 50 PRINT "

60 PRINT

NUMBER USING THE GOTO-STATEMENT."

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

90 PRINT

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

120 PRINT "

130 PRINT

140 PRINT

150 PRINT

2) REJECT THE PROGRAM WITH AN APPROPRIATE ERROR MESSAGE"

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

180 PRINT

190 PRINT "

BEGIN TEST."

200 PRINT

210 LET A$="LINE 280."

240 GOTO 275

250 PRINT "IF THIS MESSAGE APPEARS 'GOTO 275' WAS NOT EXECUTED." 260 GOTO 290

270 LET A$="LINE 270."

280 PRINT "GOTO 275' JUMPED TO "A$

290 PRINT

300 PRINT "

END TEST."

« PreviousContinue »