Along the lines of AndAlso and OrElse...
I remind everyone of “IIf“. Another tremendously useful little bit of code that I use all the time. If your If-statement is designed to set a single variable, like this one:
If Request("index") Is Nothing Then
myVariable = 0
Else
myVariable = Convert.ToInt32(Request("index")))
End If
then you can easily convert it to a single line, as follows!
(thanks Kartal) myVariable = IIf(Request("index") Is Nothing, 0, Convert.ToInt32(Request("index")))
The documentation (if it's installed: ms-help://MS.NETFrameworkSDKv1.1/vblr7net/html/vafctiif.htm) shows that it's used like this:
Public Function IIf(ByVal Expression As Boolean, ByVal TruePart As Object, ByVal FalsePart As Object) As Object
(example stolen from the TimeTracker Starter Kit: line 48 of Usercontrols\Banner.ascx.) I again can't think of any good reason not to use it.