Conditional Branching
Unconditional branching is just calling a subroutine or function on the subsequent line.
There are several different ways you can implement conditional branching.
If - Then - Else
If (iValue > 10) Then
Call MsgBox("number is greater than 10")
Else
Call MsgBox("number is less than or equal to 10")
End If
Select - Case
Select Case sText
Case "Match 1": Call Proc1()
Case "Match 2": Call Proc2()
Case Else: Call Proc3()
End Select
Immediate IF
Dim iNumber As Integer
iNumber = 50
Call Msgbox( IIf( iNumber > 40, "over forty", "less than forty") )
© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext