![background image](http://html.mh-extra.com/html/conrad/c-control-pro-mega-series/c-control-pro-mega-series_manual_2654183127.webp)
118
Compiler
© 2008 Conrad Electronic
Since the For Next loop will be used to especially optimized the counter variable must be of the
Integer type.
Example:
For i=
1
To
10
If i>a Then
a=i
End If
a=a-
1
Next
For i=
1
To
10
Step
3
'Increment i in steps of 3
If i>
3
Then
a=i
End If
a=a-
1
Next
In this location please note again that arrays are in any case zero based. A For Next loop should
thus rather run from
0
through
9
.
Exit Instruction
An Exit instruction will leave the loop and the program execution starts with the next instruction after
the For loop.
Example:
For i=
1
To
10
If i=
6
Then
Exit
End If
Next
5.3.6.4
Goto
Even though it should be avoided within structured programming languages, it is still possible with
goto to jump to a label within a procedure. In order to mark a label the command word Lab is set in
front of the label name.
' For loop with goto will realize
Sub main()
Dim a As Integer
a=
0
Lab label1
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: ......