| Contents > Developing ColdFusion MX Applications > Using ColdFusion Variables > Data type conversion > Examples of type conversion in expression evaluation |
|
|
|
|
||
The following examples demonstrate ColdFusion expression evaluation.
2 * True + "YES" - ('y' & "es")
Result value as string: "2"
Explanation: (2*True) is equal to 2; ("YES"- "yes") is equal to 0; 2 + 0 equals 2.
True AND 2 * 3
Result value as string: "YES"
Explanation: 6 is converted to Boolean True because it is nonzero; True AND True is True.
"Five is " & 5
Result value as string: "Five is 5"
Explanation: 5 is converted to the string "5".
DateFormat("October 30, 2001" + 1)
Result value as string: "31-Oct-01"
Explanation: The addition operator forces the string "October 30, 2001" to be converted to a date-time object and then to a number. The number is incremented by one. The DateFormat function requires its argument to be a date-time object; thus, the result of the addition is converted to a date-time object. One is added to the date-time object, moving it ahead by one day to October 31, 2001.
|
|
||
| Contents > Developing ColdFusion MX Applications > Using ColdFusion Variables > Data type conversion > Examples of type conversion in expression evaluation |
|
|
ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting
Version 6.1
Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/variab33.htm
Comments
Swathi_Sathish said on Oct 20, 2004 at 5:08 PM :