Microsoft KB Archive/35660: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - "<" to "<")
Line 41: Line 41:
You can substitute a WHILE ... WEND statement for the DO ... LOOP statement, as follows:</p>
You can substitute a WHILE ... WEND statement for the DO ... LOOP statement, as follows:</p>
<pre class="codesample">  X=-1
<pre class="codesample">  X=-1
   WHILE X&lt;=0 OR X &gt;= 10000
   WHILE X<=0 OR X &gt;= 10000
   INPUT &quot;Enter a number greater than 0 and less than 10,000:&quot;,X
   INPUT &quot;Enter a number greater than 0 and less than 10,000:&quot;,X
   IF X&lt;=0 OR X &gt;= 10000 THEN PRINT &quot;Out of range.&quot;
   IF X<=0 OR X &gt;= 10000 THEN PRINT &quot;Out of range.&quot;
   WEND
   WEND
                         </pre></li>
                         </pre></li>

Revision as of 09:25, 21 July 2020

Knowledge Base


DO LOOP and EXIT WHILE Not Supported in Macintosh QuickBASIC

Article ID: 35660

Article Last Modified on 11/21/2006

This article was previously published under Q35660

SUMMARY

This article describes two corrections to the "Microsoft QuickBASIC for Apple Macintosh: BASIC Language Reference" manual, Pages 154-155.

  1. The example for the IF ... THEN ... ELSE statement on Page 154 incorrectly contains a DO ... LOOP, which is not supported in QuickBASIC for the Macintosh (or in previous versions of BASIC for the Macintosh). EXIT DO also is not supported. The example program gives a "Syntax Error" for the unsupported statements.

    You can substitute a WHILE ... WEND statement for the DO ... LOOP statement, as follows:

       X=-1
       WHILE X<=0 OR X >= 10000
       INPUT "Enter a number greater than 0 and less than 10,000:",X
       IF X<=0 OR X >= 10000 THEN PRINT "Out of range."
       WEND
                            
  2. The example on Page 155 mistakenly uses an EXIT WHILE statement, which is not supported. This program gives a "Syntax Error" on the EXIT WHILE statement.



Additional query words: MQuickB

Keywords: KB35660