While...Wend: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 31: | Line 31: | ||
'''Related Items''' | '''Related Items''' | ||
[[do...loop|DO...LOOP]], [[for...next|FOR...NEXT]], [[for | [[do...loop|DO...LOOP]], [[for...next|FOR...NEXT]], [[for each...nex|FOR...EACH...NEXT]] |
Revision as of 21:20, 8 July 2012
WHILE condition
- [statements]
- [statements]
WEND
Description
WHILE...WEND repeats a group of statements while a given condition is TRUE. The required component, condition, is any valid expression that evaluates to TRUE or FALSE. The optional component, statements, are executed during each iteration of the loop. WHILE...WEND statements can be nested, and any WEND statements in a nested loop transfer execution to one level above the loop where the WEND occurs.
Example
REM WHILE...WEND Example 'WHILE...WEND repeats a group of statements DIM Counter Counter = 1 WHILE Counter < 5 PRINT "Counter = " & Counter Counter = Counter + 1 WEND
Output
Counter = 1 Counter = 2 Counter = 3 Counter = 4
Related Items