| 5 | General Code Statements |
| 5.1 | CFSCRIPT 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.2 | A code statement do not take a semicolon (;) at the end (except in a single special case). |
| 5.2 | Each code construct must have an operation after it. |
| 5.3 | multiple 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
|