{see's Rachels post} AndAlso...
Anyway, he's not a .NET guy and came back with: "does TryHarder actually exist in .NET??" :-) That kind of cracked me up, but, also reminded me of those other funny words... No, but VB has OrElse and AndAlso and they are just as silly. They are basically shortcut-evaluation versions of "Or" and "And". For example:Try . . Catch . . TryHarder . . Catch . . OhPlease
'----------------------------- Class Person Public Name As String = "Fred" End Class '----------------------------- Dim obj As Person ' This would throw an exception If TypeOf (obj) Is Person And obj.Name = "Fred" Then MsgBox( obj.Name ) End If ' This would be fine If TypeOf (obj) Is Person AndAlso obj.Name = "Fred" Then MsgBox( obj.Name ) End If '-----------------------------
The OrElse keyword *always* cracks me up because I can imagine the compiler emitting an "OrElseWhat?" exception if it fails :-)
For those (other) non-.NET'tish folk: The | operator of C/C++/C#/Java/JavaScript is the same as the VB.NET OR operator. And the || operator is the same as VB.NET's OrElse operator.