Conrad C-Control Pro Mega Series Manual page 128

Table of Contents

Advertisement

119
C-Control Pro Mega Series
a=a+1
If
a<10
Goto label1
End If
End Sub
5.3.6.5
If .. Else
An If instruction does have the following syntax:
If Expression1 Then
Instructions1
ElseIf Expression2 Then
Instructions2
Else
Instructions3
End If
After the if instruction an
unequal
0
then Instruction1 will be executed. By use of the command word else an alternative
Instruction2 can be defined which will be executed when the Expression has been calculated as
The addition of an else instruction is optional and not really necessary.
If directly in an Else branch an If instruction needs again to be placed then it is possible to initialize
an If again direcly by use of an ElseIf. Thus the new If does not need to be interlocked into an Else
block and the source text remains more clearly.
Examples:
If
a=2
Then
b=b+1
End If
If x=y Then
a=a+2
Else
a=a-2
End If
If
a<5
Then
a=a-2
ElseIf
a<10
a=a-1
Else
a=a+1
End If
Then
Arithmetic Expression
Then
will follow. If this Expression is evaluated as
0.
© 2008 Conrad Electronic

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the C-Control Pro Mega Series and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

C-control pro mega32C-control pro mega128

Table of Contents