IF <expression> THEN NEXT / THEN WEND Not Supported (31787)






This article was previously published under Q31787

SUMMARY

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"

MORE INFORMATION

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.

Modification Type: Minor Last Reviewed: 1/9/2003
Keywords: KB31787