• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

2. ColdFusion Basics > 2.4. Expressions

Expressions

Expressions are the building blocks of the CFML language. In its most basic form, an expression is nothing more than a single element such as 1, test, MyVar, or Chr(54). Compound expressions let you to evaluate data that is acted upon by operators. For example, 1*10 is a mathematical expression that evaluates to 10. The values 1 and 10 are both data, while the asterisk (*) is considered an operator. On the other end of the spectrum, expressions can be complex, consisting of one or more subexpressions:

<cfset x = 1+(10 mod (3 * (11 - acos(-1))))>

Operators

Operators allow you to perform calculations and make comparisons between expressions. In other words, they allow you to combine simple expressions to form ones that are more complex. For example,


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint