While...Wend
Positron8 · Revision 4.0.6.5 · PDF page 318
Syntax
While Condition Instructions Instructions Wend
or
While Condition { Instructions : } Wend
Overview
Execute a block of instructions while a condition is true.
Example
Device = 18F25K20 ' Use an 18F device
Declare Xtal = 16 ' Tell the compiler the device is operating at 16MHz
Declare Hserial_Baud = 9600 ' Choose the Baud rate for HRsoutLn
Dim MyWord as Word ' Create an unsigned Word variable
MyWord = 1
While MyWord <= 10
HRsoutLn Dec MyWord
MyWord = MyWord + 1
Wend
or
While PORTA.0 = 1: Wend ' Wait for a change on the Port
Notes
While-Wend, repeatedly executes Instructions While Condition is true. When the Condition is no longer true, execution continues at the statement following the Wend. Condition may be any comparison expression.
See also : Do...Loop, Repeat...Until, For...Next.
