CFScript: Difference between revisions

Content deleted Content added
m remove uncited claim
<cfscript> blocks don't need indentation, dot notation doesn't require spaces, Application shouldn't be capitalized, and LT/LTE are outdated for cfscript
Line 7:
<syntaxhighlight lang="cfm">
<cfscript>
xParam = 115;
yParam = 200;
color = 'FFCC99';
</cfscript>
</syntaxhighlight>
Line 41:
<syntaxhighlight lang="cfm">
<cfscript>
qGetData = new Query();
qGetData .setDataSource('#APPLICATIONApplication.datasource#');
qGetData .setSQL('SELECT column1, column2 FROM table WHERE 1');
qDateResult = qGetData .Execute().getResult();
</cfscript>
</syntaxhighlight>
Line 123:
==== For Loop ====
<syntaxhighlight lang="javascript">
for (i=1; i LTE<= ArrayLen(array); i=i+1) {
WriteOutput(array[i]);
}
Line 142:
<syntaxhighlight lang="javascript">
x = 0;
while (x LT< 5) {
x = x + 1;
WriteOutput(x);
Line 153:
x = 0;
do {
x = x + 1;
WriteOutput(x);
} while (x LTE<= 0);
// Outputs: 1
</syntaxhighlight>