Positron Compiler Documentation

While...Wend

Positron8 · Revision 4.0.6.5 · PDF page 318

While Condition Instructions Instructions Wend

or

While Condition { Instructions : } Wend

Execute a block of instructions while a condition is true.

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

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.

View original PDF page 318Open page in PDFOriginal PDF page 318