W3Cschool
恭喜您成為首批注冊用戶
獲得88經驗值獎勵
Nested Select Case語句可以將select語句作為外部select語句的語句序列的一部分。 即使內部和外部選擇的情況常數(shù)包含公共值,也不會出現(xiàn)沖突。
示例:
Module decisions
Sub Main()
'local variable definition
Dim a As Integer = 100
Dim b As Integer = 200
Select a
Case 100
Console.WriteLine("This is part of outer case ")
Select Case b
Case 200
Console.WriteLine("This is part of inner case ")
End Select
End Select
Console.WriteLine("Exact value of a is : {0}", a)
Console.WriteLine("Exact value of b is : {0}", b)
Console.ReadLine()
End Sub
End Module
This is part of outer case
This is part of inner case
Exact value of a is : 100
Exact value of b is : 200
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: