ColdFusion Operators
•Operators allows you to perform calculations and make comparisons between expressions.
•Allow you to combined simple expressions to form ones that are complex.
•Example: <cfset x = 10 * (2+3)>
Four types of ColdFusion operators
•Arithmetic, String, Comparison, Boolean
Arithmetic Operators
•Performs arithmitic operations such as sign changes, addition, subtraction, etc. on numeric values.
Unary +, Unary - = sign charge
^ = raise to power
*, / , +, - = multiplication, division, addition, subtraction
\ = integer division
MOD = remainder
String Operator
•There is only one string operator in CF. The ampersand (&) concatenates strings.
Comparison operator
•Compares value and return bolean true or false.
IS (EQUAL,EQ) = equality
IS NOT (NOT EQUAL,NEQ) = inequality
GREATER THAN (GT) = >
GREATER THAN OR EQUAL TO (GTE) = >=
LESS THAN (LT) = <
LESS THAN OR EQUAL TO (LTE) = <=
Boolean operator
•Also known as logical operator.
•Performs connective and negation operations and returning boolean true or false values.
NOT = logical NOT (reverse the valure of an argument)
AND = logical AND (both arguments are true)
OR = logical OR ( return true if any of the arguments is true)
XOR = logical XOR (return true if one of the value is true and the others is false)
EQV = equivalence (retrun true if both operants is true or both true of false)
Functions
•Are type of operator let you perform a predefined action on a piece of data.
•ColdFusion comes with severala hundreds of predefined functions.
•always return a value.
•Example
<cfset x = Now ()> take no arguments
<cfset x = Compare (1234,4321) take more than one arguments
<cfset x = TodaysDate - Date format (Now(), ‘mm/dd/yyyy’) nested funcions call
Conditional processing
•Make it possible to implement flow control and decission making
•Techniques for applying conditional processing:
if/else if/ else processing , switch/case processing
Looping
•Allows you to repeat specific blocks codes (HTML OR CFML) within you page
•ColdFusion supports variety of looping constracts
Index loops = also known as while loop
Conditional loops = also known as for loop
Hope you learn my basics CFML functions and soon i will post the example code of all function here in my own web page.Thank you come again.