116
Compiler
© 2008 Conrad Electronic
5.3.6
Control Structures
Control structures allow to change the program completion depending on expressions, variables or
external influences.
5.3.6.1
Do Loop While
With a Do ... Loop While construct the instructions can depending on a condition be repeated in a
loop:
Do
Instructions
Loop While Expression
The instructions are being executed. At the end the Expression is evaluated. If the result is unequal
0 then the execution of the expression will be repeated. The entire procedure will constantly be
repeated until the Expression takes on the value 0.
Examples:
Do
a=a+
2
Loop While a<
10
Do
a=a*
2
x=a
Loop While a
The essential difference between the Do Loop While loop and the normal Do While loop is the
fact that in a Do Loop While loop the instruction is executed at least once.
Exit Instruction
An Exit instruction will leave the loop and the program execution starts with the next instruction after
the Do Loop While loop.
Example:
Do
a=a+
1
If a>
10
Then
Exit
' Will terminate loop
End If
Loop While
1
' Endless loop
Summary of Contents for C-Control Pro Mega Series
Page 1: ... 2008 Conrad Electronic C Control Pro Mega Series ...
Page 9: ...VIII Inhalt 2008 Conrad Electronic ...
Page 10: ...Part 1 ...
Page 17: ...Part 2 ...
Page 23: ...Part 3 ...
Page 41: ...32 Hardware 2008 Conrad Electronic 3 3 5 3 Component Parts Plan ...
Page 57: ...48 Hardware 2008 Conrad Electronic 3 4 5 3 Component Parts Plan ...
Page 58: ...Part 4 ...
Page 91: ...82 IDE 2008 Conrad Electronic ...
Page 92: ...Part 5 ...
Page 135: ...126 Compiler 2008 Conrad Electronic 31 1F US 63 3F 95 5F _ 127 7F DEL ...
Page 136: ...Part 6 ...
Page 231: ...Part 7 ...
Page 240: ......