While Statement
Use the while keyword to conditionally iterate a statement. The syntax of the while statement is:
while expression statements wend
statements are executed repeatedly as long as expression evaluates true. The test takes place before statements are executed. Thus, if expression evaluates false on the first pass, the loop does not execute.
Here is an example of calculating scalar product of two vectors, using the while statement:
s = 0 i = 0 while i < n s = s + a[i] * b[i] i = i + 1 wend
Probably the easiest way to create an endless loop is to use the statement:
while TRUE ' ... wend
Copyright (c) 2002-2012 mikroElektronika. All rights reserved.
What do you think about this topic ? Send us feedback!
What do you think about this topic ? Send us feedback!



