VB.NETの条件判断構文(If)の使い方いろいろ
2011/08/12 11:33Update
VB.NETの条件判断構文(If)の使い方について
■条件判断構文 YES
■条件判断構文 NOT
■条件判断構文 NULL
■条件判断構文 NULL/String.Empty
■条件判断構文 NULL/""文字列
■条件判断構文 If/ElseIf/Else
■条件判断構文 And とAndAlso
■条件判断構文 OrとOrElse
.
If boolean-expression Then End If
■条件判断構文 NOT
If Not boolean-expression Then End If
■条件判断構文 NULL
If varname Is Nothing Then ' Not varname Is Nothing End If
■条件判断構文 NULL/String.Empty
If varname Is String.Empty Then ' Dim varname As String End If If varname.Equals(String.Empty) Then End If If varname = String.Empty Then End If
■条件判断構文 NULL/""文字列
If varname = "" Then ' Dim varname As String
End If
If varname.Equals("") Then
End If
If varname Is Nothing OrElse varname.Length = 0 Then
End If
■条件判断構文 If/ElseIf/Else
If boolean-expression Then ElseIf boolean-expression Then Else End If
■条件判断構文 And とAndAlso
If boolean-expression1 AndAlso boolean-expression2 Then End If
If boolean-expression1 And boolean-expression2 Then End If
■条件判断構文 OrとOrElse
If boolean-expression1 OrElse boolean-expression2 Then End If
If boolean-expression1 Or boolean-expression2 Then End If
.
Sponsored Link
Comments
- Relative Articles
- VB.NET メール送信例 - (2011/08/31 13:34)
- VB.NETの異常処理 - Try ~ Catch ~ 構文 例 - (2011/08/10 15:07)
- VB.NETのHTTPダウンロード例 - (2011/08/10 15:23)
- VB.NETでのインスタンスについて - (2011/08/10 16:16)
- VB.NETの名前空間定義 - (2011/08/10 16:57)
- VB.NET クラスの定義 - (2011/08/10 17:47)
- VB.NET インタフェースの定義とその使用例 - (2011/08/11 11:35)
- VB.NET クラスのコンストラクタ - (2011/08/11 11:55)
- VB.NET getter/setterメソッドの定義方法 - (2011/08/11 16:46)
- VB.NETの列挙体定義 - (2011/08/12 11:02)