150 likes | 348 Views
CFIF. From the ground up. Who am I. Michael Dinowitz Head of House of Fusion Publisher of Fusion Authority Founding member of Team Macromedia CTO of Dinowitz and Associates Using ColdFusion since June 1995. Boolean. True / False “Yes” / “No” !0 / 0. Basic syntax. <CFIF Boolean>
E N D
CFIF From the ground up
Who am I • Michael Dinowitz • Head of House of Fusion • Publisher of Fusion Authority • Founding member of Team Macromedia • CTO of Dinowitz and Associates • Using ColdFusion since June 1995
Boolean • True / False • “Yes” / “No” • !0 / 0
Basic syntax • <CFIF Boolean> • <CFIF 1> • <CFIF True> • <CFIF “Yes”>
Evaluation - 1 level • <CFIF Variable> • CFIF Is an evaluation zone • <CFIF IsTrue> • Is True is a variable with the value True
Comparison – 1 level • <CFIF “name” is “Michael”> • Comparison syntax IS / EQ / Equal Is Not / NEQ / Not Equal Contains Does not Contain Greater Than / GT Greater Than or Equal To / GTE Less Than / LT Less Than or Equal TO / LTE
Comparison/Evaluation • <CFIF Name is “Michael”> • 2 steps • One for the evaluation of name • The second for the comparison
Functional Comparison • <CFIF IsDefined(‘var’) is True> • 2 steps • 1 for the function evaluation • 1 for the comparison Should be 1 step <CFIF IsDefined(‘var’)> IsDefined returns a boolean
Multiple Clauses • <CFIF clause 1 joiner clause 2> • <CFIF name is “michael” and age is 11> • AND - Clause 1 and clause 2 • OR - either or can be true • NOT - negation • EQV - both clauses must be the same (true of false) • IMP - if clause 1 is true and clause 2 is false, then its false otherwise true • XOR - one or the other but not both
Short Circuited Boolean Evaluation • Introduced in CF 4.01 • Shortens the operation of multi-clause comparisons using logic • If the joiner is AND and the first clause fails, the whole comparison fails • If the joiner is OR and the first clause succeeds then the whole comparison succeeds
Parenthesis • Separates between logical chunks