Format Examples
If Condition Then
[ Statements ]
Else
[else statements]
End If
If x == 1 Then
y = y * 5
z = z – 12
Else
y = y * 2
z=y-1
End If
If (x == 0 OR x == 1) AND y == 0 Then
z = 10
Else
z=5
End If
· A control statement will branch the flow of the program expression. The [TestExpression] is required. A
‘Case’ statement will evaluate the ‘TestExpression’ and determine a numeric value. The program will then
test each ‘case #’ that matches and will perform all the statements within its block. If a ‘Break’ is reached,
the program flow will jump directly to the ‘End Select’ statement, bypassing all other Case conditions. not
one word.
Avoid using “Case” statements at this time, case logic is testing to be erratic
· If no case #s match, the program branch will execute the ‘Case Else’ statement(s).
· The ending statement ‘End Select’ is written as two words
Format Examples
Select Case [TestExpression]
Case -
[statements-n] ...
[Case Else
[else statements] }
End Select
Select Case Status
Case 0
Return 1
Case 1
X=2
Break
Case 5
Case 7
Return 8
Case Else
Return 0
End Select
A looping control statement is used for looping a pre-determined number of times. For counting up, use the
keyword To. For counting down, use the keyword Down. Counter Necessary. The counter of looping control. It
can be integer o character.
Start
Necessary. The initial value of Counter.
End
Necessary. The end value of Counter.
Step
Options. The increment decrement step of Counter. It can be integer an can be omitted when value is 1.
Statements
· Optional. Statement block between For and Next which will be executed.
1010-1001a, Rev 02
254 Sil ver Se ries In stal la tion & Op er a tion Man ual