Instructions
205 C-Control Pro IDE
© 2013 Conrad Electronic
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
4.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
a=a+1
If a<10 Then
Goto label1
End If
End Sub
4.3.6.5 If .. Else
An If instruction does have the following syntax:
If Expression1 Then
Instructions1
ElseIf Expression2 Then