【VB】Ifの使い方③
<今回の目的>
Ifの使い方のみっつ目を記載しています。
以下、ソースを記載します。
' Ifの使い方③
' AndとAndAlsoの違い
' And・・・・・全て評価をして結果を返す
' AndAlso・・・1つずつ評価して結果を返す
' Andを使う
' (True = False) = False・・・評価する
' (True = True) = True ・・・評価する
If True = False And True = True Then
Console.WriteLine("一致する")
Else
Console.WriteLine("一致しない")
End If
' AndAlsoを使う
' (True = False) = False・・・評価する
' (True = True) = True ・・・評価しない
If True = False AndAlso True = True Then
Console.WriteLine("一致する")
Else
Console.WriteLine("一致しない")
End If

