House of Fusion
Home of the ColdFusion Community
Subscribe Now
Fusion Authority Quarterly Update - ColdFusion 8 Special Edition
Search over 2,500 ColdFusion resources here  >>>      

CFSCRIPT: General Code Statements

5General Code Statements
5.1CFSCRIPT uses a number of standard code statements that resemble those used in ECMAScript (JavaScript). They are used for Decisions (IF, Switch), loops (FOR, While, etc.) and function creation (UDF).
5.2A code statement do not take a semicolon (;) at the end (except in a single special case).
5.2Each code construct must have an operation after it.
5.3multiple operations can be grouped with a single code statement by placing them within curly brackets ({}).
<CFSCRIPT>
     // An IF statement with a block of code after it
     IF (statement)
     {
          operation1;
          operation2;
          operation3;
     }
</CFSCRIPT>
5.4 A code statement can have additional code statements after it, even if the additional code statements are within a block.
<CFSCRIPT>
     // An IF statement with a block of code after it
     IF (statement)
     {
          IF(statement);
               inner operation1;
          outer operation1;
          outer operation2;
     }
</CFSCRIPT>
5.5 The following code statements are currently available:
     IF/ELSE statements
     Switch/Case statements
     For loops
     While loops
     Do While loops
     For In loops
     User Defined Function definitions


User Contributed Notes


Add a Note


CFScript