If (Not) / And / Or / ElseIf / End If

Takes a variable number of conditional statements

Description:

Traditional If / End If conditional block(s) to assist with flow control of a procedure.

These conditions in an If / End If block can take two forms:

  1. If Field/Expression (Boolean)
  2. If Field/Value Condition Field/Value/Expression (Condition)

When Boolean:

When Condition:

And / Or / ElseIf / Else:

Notes:

Examples:

If Req.Mode = "Post"
abc = 123
def = 456
End If
If Req.Mode = "Post" : And Req.HasFile
Or Req.Mode = "Get" : And Not Req.HasFile
abc = 123
ElseIf Not (SessionIsGroupType$ "DB Admin, Office Admin, Office")
abc = 321
ElseIf 456 == (abc - def)
HtmlAlert "When testing Math, use the doubled-up Math operators"
zxy = 456
ElseIf bOther
def = 654
If bFinal Then Other.Method.DoSomething
Else
def = 456
End If
If (SessionIsGroupType$ "DB Admin, Office Admin, Office")
HtmlAlert "When evaluating an expression, surround it with ( )"
End If
If 65 >> 7
HtmlAlert "This is true because this is the numerical comparison operator"
End If

If 65 > 7
HtmlAlert "Does not display because this is the text comparison operator"
End If
[New]   True     = "y"
[New]   False   = ""

If True : HtmlAlert "This is true" : End If

If False
    HtmlAlert    "Does not display"
End If

If True : And True
    HtmlAlert    "This is true"
End If

If False : And False
    HtmlAlert    "Does not display"
End If

If True : And True : And False
    HtmlAlert    "Does not display"
End If

If True : Or True
    HtmlAlert    "This is true"
End If

If True : Or False
    HtmlAlert    "This is true"
End If

If True : And True
Or False
    HtmlAlert    "This is true"
End If

If True
Or False : And True
    HtmlAlert    "This is true"
End If

If True
Or False : And False
    HtmlAlert    "This is true"
End If

If False
Or False : And True
    HtmlAlert    "Does not display"
End If

If True : And False
Or True : And True
    HtmlAlert    "This is true"
End If

If False : Or False : Or False : Or True : Or False : Or False
    HtmlAlert    "This is true"
End If