If testexpression matches any Case expressionlist expression
, The statement between this Case clause and the next Case clause is executed.
The statement between the clause and End Select is executed, and then the control
It will be converted to the statement after End Select. For example, testexpression and multiple
The expressionlist expression in the Case clause matches only the first expression.
The statement is executed. Case Else is used to indicate that
And expressionlist of any other Case options.
Line elsestatements. Although not necessary, it is best to use Case Else
The statement is placed in the Select Case block to process unpredictable testexpression values.
. If no Case expressionlist matches testexpression and no
Case Else statement, continue to execute the statement after End Select.
Select Case testexpression [Case expressionlist-n
[Statements-n]... [Case Else expressionlist-n
[Elsestatements-n] End Select
<% @ Page Language = "VB" %>
<Script runat = "server">
Sub Page_Load (Sender as object, e as eventargs)
Dim strClockStatus As String
StrClockStatus = "AAA"
Select Case strClockStatus
Case "AAA", "BBB", "CCC"
Response. Write ("")
Case "DDD"
Response. Write ("B ")
Case else
Response. Write ("C ")
End select
End sub
</Script>
<Html> <body>
</Body>
Instance 2
<% @ Page Language = "VB" %>
<Script runat = "server">
Sub Page_Load (Sender as object, e as eventargs)
Dim intAge As integer = 7
Select Case intAge
Case "7"
Response. Write ("That's a string! ")
Case 7
Response. Write ("7 ")
Case <10
Response. Write ("less than 10 ")
End select
End sub
</Script>
<Html> <body>
</Body>