Update coldfusion.html.markdown

Adds a few more examples
This commit is contained in:
wboka 2015-10-05 21:07:13 -04:00
parent 1e7f639755
commit b8ad751cc0

View File

@ -25,8 +25,10 @@ ColdFusion is a scripting language for web development.
<!--- Displaying simple data --->
<!--- Use <cfoutput> for simple values such as strings, numbers, and expressions --->
<cfoutput>#myVariable#</cfoutput> <!--- myValue --->
<cfoutput>#myNumber#</cfoutput> <!--- 3.14 --->
<cfoutput>#myVariable#<br /></cfoutput> <!--- myValue --->
<cfoutput>#myNumber#<br /></cfoutput> <!--- 3.14 --->
<hr />
<!--- Declaring complex variables --->
<!--- Declaring an array of 1 dimension: literal or bracket notation --->
@ -40,19 +42,23 @@ ColdFusion is a scripting language for web development.
<!--- Operators --->
<!--- Arithmetic --->
<cfoutput>#1 + 1#</cfoutput> = 2
<cfoutput>#10 - 8#</cfoutput> = 2
<cfoutput>#1 * 2#</cfoutput> = 2
<cfoutput>#10 / 5#</cfoutput> = 2
<cfoutput>#12 % 5#</cfoutput> = 0
<cfoutput>#1 + 1#<br /></cfoutput> = 2
<cfoutput>#10 - 8#<br /></cfoutput> = 2
<cfoutput>#1 * 2#<br /></cfoutput> = 2
<cfoutput>#10 / 5#<br /></cfoutput> = 2
<cfoutput>#12 % 5#<br /></cfoutput> = 0
<hr />
<!--- Comparison --->
<cfoutput>#1 eq 1#</cfoutput> <!--- TRUE --->
<cfoutput>#15 neq 1#</cfoutput> <!--- TRUE --->
<cfoutput>#10 gt 8#</cfoutput> <!--- TRUE --->
<cfoutput>#1 lt 2#</cfoutput> <!--- TRUE --->
<cfoutput>#10 gte 5#</cfoutput> <!--- TRUE --->
<cfoutput>#1 lte 5#</cfoutput> <!--- TRUE --->
<cfoutput>#1 eq 1#<br /></cfoutput> <!--- TRUE --->
<cfoutput>#15 neq 1#<br /></cfoutput> <!--- TRUE --->
<cfoutput>#10 gt 8#<br /></cfoutput> <!--- TRUE --->
<cfoutput>#1 lt 2#<br /></cfoutput> <!--- TRUE --->
<cfoutput>#10 gte 5#<br /></cfoutput> <!--- TRUE --->
<cfoutput>#1 lte 5#<br /></cfoutput> <!--- TRUE --->
<hr />
<!--- Control Structures --->
<cfset myCondition = "Test" />
@ -63,36 +69,17 @@ ColdFusion is a scripting language for web development.
<cfelse>
myCondition is unknown
</cfif>
<hr />
<!--- Loops --->
<cfloop from="0" to="10" index="i">
<cfoutput>#i# <br /></cfoutput>
</cfloop>
<hr />
```
<!-- // While loop
int fooWhile = 0;
while(fooWhile < 100) {
System.out.println(fooWhile);
// Increment the counter
// Iterated 100 times, fooWhile 0,1,2...99
fooWhile++;
}
System.out.println("fooWhile Value: " + fooWhile);
// Do While Loop
int fooDoWhile = 0;
do {
System.out.println(fooDoWhile);
// Increment the counter
// Iterated 99 times, fooDoWhile 0->99
fooDoWhile++;
} while(fooDoWhile < 100);
System.out.println("fooDoWhile Value: " + fooDoWhile);
// For Loop
int fooFor;
// for loop structure => for(<start_statement>; <conditional>; <step>)
for (fooFor = 0; fooFor < 10; fooFor++) {
System.out.println(fooFor);
// Iterated 10 times, fooFor 0->9
}
System.out.println("fooFor Value: " + fooFor);
<!--
// For Each Loop
// The for loop is also able to iterate over arrays as well as objects
// that implement the Iterable interface.