Is anybody aware of these two keywords OrElse and AndAlso in Vb.Net.
These keywords were introduced in .Net 2.0 .
Dim myobj As Object
If Not IsNothing(myobj) AndAlso myobj.y = 200 Then Console.WriteLine(
"Hello World")
End If
If the myObj is null or nothing then the If condition shortcircuits and will not validate the condition myObj.y=200 .
I would advise everybody to use the andAlso and orElse. I wonder why it was not introduced a long time back.
C# by default had this feature by the use && and ||.