VB.Net Syntax
And
If (oMyObject Is Nothing) And (bUpdate = False) Then
End If
AndAlso
Performs short-circuiting logical.
A logical operation is said to be short-circuiting if the compiled code can bypass the evaluation of one expression depending on the result of another expression.
This means if the first expression is False the expression returns False and does not evaluated the second expression.
If (oMyObject Is Nothing) AndAlso (oMyObject.Property = True) Then
End If
Expression | Returned | Notes |
True AndAlso True | True | |
True AndAlso False | False | |
False AndAlso True | False | True is not evaluated |
False AndAlso False | False | False is not evaluated |
Not (True AndAlso True) | False | |
Not (True AndAlso False) | True | |
Not (False AndAlso True) | True | |
Not (False AndAlso False) | True |
Or
If (oMyObject Is Nothing) Or (sFullName = "Steven") Then
End If
OrElse
Performs short-circuiting inclusive logical.
A logical operation is said to be short-circuiting if the compiled code can bypass the evaluation of one expression depending on the result of another expression.
This means if the first expression is True the expression returns False and does not evaluated the second expression.
If (oMyObject Is Nothing) OrElse (sFullName = "Steven") Then
End If
Expression | Returned | Notes |
True OrElse True | True | True is not evaluated |
True OrElse False | True | False is not evaluated |
False OrElse True | True | |
False OrElse False | False | |
Not (True OrElse True) | False | |
Not (True OrElse False) | False | |
Not (False OrElse True) | False | |
Not (False OrElse False) | True |
Not
Xor
Performs short-circuiting inclusive logical.
A logical operation is said to be short-circuiting if the compiled code can bypass the evaluation of one expression depending on the result of another expression.
This means
If (oMyObject Is Nothing) Xor (sFullName = "Steven") Then
End If
Expression | Returned | Notes |
True Xor True | True | |
True Xor False | ||
False Xor True | ||
False Xor False | ||
Not (True Xor True) | ||
Not (True Xor False) | ||
Not (False Xor True) | ||
Not (False Xor False) |
Modulus
Mod (eg 10 Mod 5)
Like
There is no C# equialent, you have to use regular expressions.
© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext