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
Содержание C-Control Pro Mega Series
Страница 1: ... 2008 Conrad Electronic C Control Pro Mega Series ...
Страница 9: ...VIII Inhalt 2008 Conrad Electronic ...
Страница 10: ...Part 1 ...
Страница 17: ...Part 2 ...
Страница 23: ...Part 3 ...
Страница 41: ...32 Hardware 2008 Conrad Electronic 3 3 5 3 Component Parts Plan ...
Страница 57: ...48 Hardware 2008 Conrad Electronic 3 4 5 3 Component Parts Plan ...
Страница 58: ...Part 4 ...
Страница 91: ...82 IDE 2008 Conrad Electronic ...
Страница 92: ...Part 5 ...
Страница 135: ...126 Compiler 2008 Conrad Electronic 31 1F US 63 3F 95 5F _ 127 7F DEL ...
Страница 136: ...Part 6 ...
Страница 231: ...Part 7 ...
Страница 240: ......