Microsoft KB Archive/65599

= SELECT CASE Documentation Error in &quot;Learn Basic Now&quot;, MS Press =

Article ID: 65599

Article Last Modified on 11/21/2006

-

APPLIES TO


 * Microsoft QuickBasic 4.5 for MS-DOS

-



This article was previously published under Q65599



SUMMARY
In the book &quot;Learn Basic Now&quot; (Microsoft Press, 1989), an incorrect example of the SELECT CASE statement is shown on Pages 116 and 117.

Page 116 Example
The (incorrect) example at the bottom of Page 116 is as follows: SELECT CASE userNum% CASE IS 1 TO 5 PRINT &quot;The number you entered was between 1 and 5.&quot; CASE IS 6 TO 10 PRINT &quot;The number you entered was between 6 and 10.&quot; END SELECT The SELECT CASE example on Page 116 should be corrected to read as follows: SELECT CASE userNum% CASE 1 TO 5 PRINT &quot;The number you entered was between 1 and 5.&quot; CASE 6 TO 10 PRINT &quot;The number you entered was between 6 and 10.&quot; END SELECT

Page 117 Example
The (incorrect) code example on Page 117 is as follows: SELECT CASE word$ CASE IS &quot;a&quot; TO &quot;m&quot; PRINT &quot;The word you entered was in the range a to m.&quot; CASE IS &quot;m&quot; to &quot;z&quot; PRINT &quot;The word you entered was in the range m to z.&quot; END SELECT The code example on Page 117 should be corrected to read as follows: SELECT CASE word$ CASE &quot;a&quot; TO &quot;m&quot; PRINT &quot;The word you entered was in the range a to m.&quot; CASE &quot;m&quot; to &quot;z&quot; PRINT &quot;The word you entered was in the range m to z.&quot; END SELECT



MORE INFORMATION
The examples on Pages 116 and 117 incorrectly use the IS keyword in the CASE statement. The IS keyword should only be used when specifying a relational operator, such as <=, >=, =, or <> in a conditional expression. For example CASE IS <= 5 correctly uses the IS keyword.

SELECT CASE is correctly described in the Online Help system of the Microsoft QuickBasic Interpreter (QBI.EXE version 1.00) on the disk that comes with the &quot;Learn Basic Now&quot; book.

QBI.EXE version 1.00 has the same language features as QuickBasic version 4.50, but note that QBI.EXE is just an interpreter and cannot create .EXE programs.

Additional query words: QuickBas

Keywords: KB65599

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.