Page images
PDF
EPUB

5075 IF F$="F*" THEN 5200 5080 GOTO 5210

5200 LET N$="FAILED"

5205 LET R$="FAILED"

5210 REM RESULTS CHECKED

5510 PRINT TAB(38); A$; TAB (42); B$; TAB (46); C$; TAB(50); D$;

5520 PRINT

5530 RETURN

9999 END

TAB(54); E$; TAB(58); F$; TAB(62); N$

PROGRAM FILE 19: THE IF-THEN STATEMENT WITH NUMERIC OPERANDS
ANSI STANDARD 10.2, 10.4

SECTION 19.1: THE IF-THEN STATEMENT WITH NUMERIC OPERANDS.

THIS SECTION TESTS THE COMPARISON OF NUMERIC VARIABLES AND
CONSTANTS WITH A VARIETY OF NUMERIC VALUES. ALL RELATIONSHIPS
(=, <, >, <>, <=, >=) ARE TESTED FOR EACH PAIR OF VALUES.
THE 'V' OR 'C' FOLLOWING THE COMPARAND VALUE INDICATES
WHETHER IT IS A VARIABLE OR A CONSTANT.

'T' OR 'F' IS PRINTED TO SHOW THE OUTCOME OF THE COMPARISON. FOR INCORRECT COMPARES, AN '*' IS PRINTED NEXT TO THE ERRONEOUS RESULT.

[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][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][subsumed][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][ocr errors][ocr errors][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][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][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small]

IF-THEN STATEMENT WITH A STRING AND"

10 PRINT "PROGRAM FILE 20: ERROR
20 PRINT "
NUMERIC OPERAND."
30 PRINT " ANSI STANDARD 10.2"
40 PRINT

50 PRINT "SECTION 20.1: ERROR IF-THEN STATEMENT WITH A STRING AND" 60 PRINT "

70 PRINT

NUMERIC OPERAND."

80 PRINT "THIS PROGRAM ATTEMPTS TO COMPARE A STRING VARIABLE WITH A" 90 PRINT "NUMERIC VARIABLE IN AN IF-THEN STATEMENT."

100 PRINT

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

130 PRINT

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

160 PRINT "

170 PRINT

180 PRINT " 2) REJECT THE PROGRAM WITH AN APPROPRIATE ERROR MESSAGE" 190 PRINT

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

[blocks in formation]

10 PRINT "PROGRAM FILE 21: ERROR - TRANSFER TO NON-EXISTING LINE"

15 PRINT

NUMBER USING THE IF-THEN-STATEMENT."

20 PRINT

ANSI STANDARD 10.4"

30 PRINT

40 PRINT "SECTION 21.1: ERROR 50 PRINT "

[ocr errors]

TRANSFER TO NON-EXISTING LINE NUMBER" USING THE IF-THEN-STATEMENT."

60 PRINT

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 "

110 PRINT "

120 PRINT "

130 PRINT

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

140 PRINT " 2) REJECT THE PROGRAM WITH AN APPROPRIATE ERROR MESSAGE" 150 PRINT

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

180 PRINT

190 PRINT "

200 PRINT

230 LET A$="LINE 300."

240 LET A=5

250 IF A=5 THEN 295

BEGIN TEST."

260 PRINT "IF THIS MESSAGE APPEARS THE IF-THEN-STATEMENT WAS NOT" 270 PRINT "EXECUTED."

[blocks in formation]

10 PRINT "PROGRAM FILE 22: NUMERIC AND STRING VARIABLE NAMES" 20 PRINT "

WITH THE SAME INITIAL LETTER."

30 PRINT " ANSI STANDARD 6.2, 6.4"

40 PRINT

50 PRINT "SECTION 22.1: NUMERIC AND STRING VARIABLE NAMES WITH THE" 60 PRINT "

70 PRINT

SAME INITIAL LETTER."

80 PRINT "THE STANDARD ESTABLISHES A NAME SPACE OF AT LEAST 286 NUMERIC" 90 PRINT "DATA NAMES (A

Z, AO

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

ZO, A1 Z1, 100 PRINT "DISTINCT STRING DATA NAMES (A$ 102 PRINT

104 PRINT "THIS PROGRAM TESTS THAT DISTINCT VALUES ARE PRESERVED" 106 PRINT "IN VARIABLES WITH SIMILAR, BUT NOT IDENTICAL, NAMES."

110 PRINT

120 PRINT "

130 PRINT

BEGIN TEST."

140 LET A=10
150 LET A$="ABC"

155 LET AO=A

160 LET A0=100

170 LET A9=109

180 LET B1=123E22

190 LET BO=-123E-22

200 LET B$="18 CHARACTERS LONG" 210 LET B=33

220 IF A<>10 THEN 320

230 IF A$<>"ABC" THEN 320

240 IF A9<> 109 THEN 320

250 IF AO<>100 THEN 320

260 IF B<>33 THEN 320

270 IF B$<>"18 CHARACTERS LONG" THEN 320

280 IF B1<>123E22 THEN 320

290 IF BO<>-123E-22 THEN 320

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

PROGRAM FILE 22: NUMERIC AND STRING VARIABLE NAMES

WITH THE SAME INITIAL LETTER.

ANSI STANDARD 6.2, 6.4

SECTION 22.1: NUMERIC AND STRING VARIABLE NAMES WITH THE
SAME INITIAL LETTER.

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

THIS PROGRAM TESTS THAT DISTINCT VALUES ARE PRESERVED
IN VARIABLES WITH SIMILAR, BUT NOT IDENTICAL, NAMES.

[blocks in formation]

**

****

10 PRINT "PROGRAM FILE 23: INITIALIZATION OF STRING AND NUMERIC" 20 PRINT " VARIABLES."

30 PRINT " ANSI STANDARD 6.6"

40 PRINT

50 PRINT "SECTION 23.1: INITIALIZATION OF STRING AND NUMERIC" 60 PRINT "

70 PRINT

VARIABLES."

80 PRINT "THIS PROGRAM TESTS HOW THE IMPLEMENTATION TREATS"
90 PRINT "UNINITIALIZED VARIABLES. THE MINIMAL BASIC STANDARD"
100 PRINT "RECOMMENDS THAT THIS CONDITION BE TREATED AS AN "
110 PRINT "EXCEPTION. IN ANY CASE, THE DOCUMENTATION MUST"
120 PRINT "DESCRIBE THE ACTION OF THE PROCESSOR IN ORDER"
130 PRINT "FOR THE TEST TO PASS."

140 PRINT

150 PRINT "

160 PRINT

BEGIN TEST."

170 PRINT "NEITHER A$ OR Y HAS BEEN ASSIGNED A VALUE." 180 PRINT

190 PRINT "THE IMPLEMENTATION-DEFINED INITIAL VALUE (SURROUNDED" 200 PRINT " BY APOSTROPHES) FOR A$=";"'"; A$;"'"

210 PRINT "THE IMPLEMENTATION-DEFINED INITIAL VALUE FOR Y = ";Y 220 PRINT

230 PRINT "IF THE DOCUMENTATION FOR THIS IMPLEMENTATION CORRECTLY" 240 PRINT " DESCRIBES THE RESULTS ABOVE, THEN"

[blocks in formation]

SECTION 23.1: INITIALIZATION OF STRING AND NUMERIC
VARIABLES.

THIS PROGRAM TESTS HOW THE IMPLEMENTATION TREATS
UNINITIALIZED VARIABLES. THE MINIMAL BASIC STANDARD
RECOMMENDS THAT THIS CONDITION BE TREATED AS AN
EXCEPTION. IN ANY CASE, THE DOCUMENTATION MUST
DESCRIBE THE ACTION OF THE PROCESSOR IN ORDER
FOR THE TEST TO PASS.

BEGIN TEST.

NEITHER A$ OR Y HAS BEEN ASSIGNED A VALUE.

« PreviousContinue »