最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
vb.net switch 语句的使用方法
时间:2022-06-25 05:33:57 编辑:袖梨 来源:一聚教程网
CopyPublic Function Switch( _
ByVal ParamArray VarExpr() As Object _
) As Object
实例
Function matchLanguage(ByVal cityName As String) As String
Return CStr(Microsoft.VisualBasic.Switch( _
cityName = "London", "English", _
cityName = "Rome", "Italian", _
cityName = "Paris", "French"))
End Function
再看一个简单的实例
Module Module1
Sub Main()
Dim intValue As Integer = -10
Console.WriteLine("Absolute value: " & _
Microsoft.VisualBasic.Switch(intValue = 0, intValue))
End Sub
End Module
如果缩合switch case语法如下
Case后面需要的是值或值的范围。你现在Case后面的表达式求得的是True或False。
要么全用If,要么如下修改
VB.NET code
select case myrow1.Cells("积分").Value
case 0
...
case 60 to 79
...
case 80 to 99
...
case is > 100
...
case else
...
end select
相关文章
- 《燕云十六声》探游任务影灯戏话攻略-滹沱区域任务详解 08-06
- 《燕云十六声》不见山滹沱行军推演小游戏玩法分享 08-06
- 《仁王3》斋藤福角色图鉴-斋藤福详细介绍 08-06
- 《仁王3》武田信玄角色图鉴-战国霸主甲斐之虎介绍 08-06
- 风启之旅解救七名水手任务完成方法 08-06
- 《仁王3》卑弥呼角色图鉴-古代女王神秘力量解析 08-06