CFScript: Difference between revisions

Content deleted Content added
Doggum (talk | contribs)
No edit summary
Doggum (talk | contribs)
No edit summary
Line 56:
 
Since Coldfusion 8 cfscript has supported syntax abbreviations that are common in many other programming languages, such as "++", "<=" and "+=".<ref>Nadel, Ben. http://www.bennadel.com/blog/741-Learning-ColdFusion-8-All-Hail-The-New-Operator.htm</ref>
 
== Differences from JavaScript ==
Although CFScript and JavaScript are similar, they have several key differences. The following list identifies CFScript features that differ from JavaScript:
 
* CFScript uses ColdFusion expressions, which are not a superset or a subset of JavaScript expressions. In particular, ColdFusion expressions do not support bitwise operators, and the ColdFusion MOD or % operator operates differently from the corresponding JavaScript % operator: In ColdFusion, the operator does integer arithmetic and ignores fractional parts. ColdFusion expressions also support the EQV, IMP, CONTAINS, and DOES NOT CONTAIN operators that are not supported in JavaScript.
* Variable declarations (var keyword) are only used in user-defined functions and threads.
* CFScript is not case sensitive.
* All statements end with a semicolon, and line breaks in the code are ignored.
* Assignments are statements, not expressions, and therefore cannot be used in situations that require evaluating the assignment operation.
* JavaScript objects, such as Window and Document, are not available.
* Only the ColdFusion server processes CFScript. There is no client-side CFScript.
 
 
==References==