vb学习--条件语句
上一篇 /
下一篇 2013-07-24 06:03:48
1、if ……then
Sub FixDate()
Dim myDate
myDate = #2/13/95#
If myDate < Now Then myDate = Now
End Sub
2、if ……then ……else
Sub ReportValue(value)
If value = 0 Then
MsgBox value
ElseIf value = 1 Then
MsgBox value
ElseIf value = 2 then
Msgbox value
Else
Msgbox "数值超出范围!"
End If
3、select …… case
Select Case Document.Form1.CardType.Options(SelectedIndex).Text--变量
Case "MasterCard"--值
DisplayMCLogo
ValidateMCAccount
Case "Visa"
DisplayVisaLogo
ValidateVisaAccount
Case "American Express"
DisplayAMEXCOLogo
ValidateAMEXCOAccount
Case Else
DisplayUnknownImage
PromptAgain
End Select
收藏
举报
TAG: