Conditional Operators
= |
Is equal to |
<> |
Not equal to |
< |
Less than |
> |
Greater than |
<= |
Less than or equal to |
>= |
Greater than or equal to |
Logical Operators
And |
Both conditions must be true |
Or |
Both or either condition can be true |
Not |
Returns the opposite of the Boolean condition |
If condition Then statements [Else elsestatements]
Or
If condition Then
[statement]
[Else If condition-n Then
[elseif statements] ]…
[Else
[elsestatements] ]
End If
If (1=3) then
Do something
End if
Select Case testexpression
[Case expressionlist-n
[statements-n] ] …
[Case Else expressionlist-n
[elsestatements-n] ]
End Select
Select case txtAnimal.text.toUpper()
Case”Dog”
Messagebox.show(“Woof”)
Case “Cat”
Messagebox.show(“Meow”)
Case else
Messagebox(“Hello”)
End select
For counter = start To end [Step step]
[statement]
[Exit For]
[statement]
Next
For Each element In group
[statement]
[Exit For]
[statement]
Next [element]
Do [ {While | Until } condition] |
Do |
[statement] |
[statement] |
[Exit Do] |
[Exit Do] |
[statement] |
[statement] |
[Loop] |
Loop [ { While | Until } condition ] |