Select...Case structure is an alternative to
If...Then...Else. It for selectively executing a single block of statements
from among multiple block of statements. Select...case is
more convenient to use than the If...Else...End If. The
following program block illustrate the working of Select...Case.
Syntax of the Select...Case selection structure:
Select Case Index
Case 0
Statements 1
Case 1
Statements 2
End Select
e.g.: Assume you have to find the grade using select...case and display in the text box
Dim average as Integer
---
Private Sub Cmd_Click(Index As Integer)
Select Case Index
Case 0
Call save
Case 1
Call delete
End Select
End Sub
---
Syntax of the Select...Case selection structure:
Select Case Index
Case 0
Statements 1
Case 1
Statements 2
End Select
e.g.: Assume you have to find the grade using select...case and display in the text box
Dim average as Integer
---
Private Sub Cmd_Click(Index As Integer)
Select Case Index
Case 0
Call save
Case 1
Call delete
End Select
End Sub
---