KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q31787: IF <expression> THEN NEXT / THEN WEND Not Supported

Article: Q31787
Product(s): See article
Version(s): 3.00 4.00 4.00b 4.50
Operating System(s): MS-DOS
Keyword(s): ENDUSER | B_BasicCom | mspl13_basic
Last Modified: 20-DEC-1989

You cannot conditionally execute NEXT and WEND statements using the
single-line IF...THEN...ELSE statement.

The following two syntax examples, which are supported by GW-BASIC and
QuickBASIC Version 2.01 and previous versions, are not supported by
QuickBASIC Versions 3.00 and later:

   IF <boolean expression> THEN NEXT

   IF <boolean expression> THEN WEND

Using this illegal syntax will give the following error message at
compile time:

   "NEXT without FOR" or "WEND without WHILE"

This situation is documented in the following manuals:

1. Page 272 of the "Microsoft QuickBASIC 4.00: Learning and Using"
   manual.

2. Page 272 of the "Microsoft BASIC Compiler Version 6.00 for MS-DOS
   and OS/2: Learning and Using QuickBASIC"

3. Gray Page Update-57 of the "Microsoft QuickBASIC Version 3.00
   Update" manual.

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.