From 88d1bb7c8403da7142f2ba013231183f28104548 Mon Sep 17 00:00:00 2001 From: wboka Date: Wed, 7 Oct 2015 16:54:19 -0400 Subject: [PATCH] Update coldfusion.html.markdown Additions to the control structures. Added more user-friendly output for .cfm file --- coldfusion.html.markdown | 143 +++++++++++++++++++++++---------------- 1 file changed, 85 insertions(+), 58 deletions(-) diff --git a/coldfusion.html.markdown b/coldfusion.html.markdown index b8fe9359..6a9b69f0 100644 --- a/coldfusion.html.markdown +++ b/coldfusion.html.markdown @@ -9,6 +9,9 @@ ColdFusion is a scripting language for web development. [Read more here.](http://www.adobe.com/products/coldfusion-family.html) ```ColdFusion + +HTML tags have been provided for output readability + " ---> - +

Simple Variables

+

Set myVariable to "myValue"

+

Set myNumber to 3.14

-#myVariable#
-#myNumber#
+

Display myVariable: #myVariable#

+

Display myNumber: #myNumber#


+

Complex Variables

+

Set myArray1 to an array of 1 dimension using literal or bracket notation

+

Set myArray2 to an array of 1 dimension using function notation

+

Contents of myArray1

- +

Contents of myArray2

+ -#1 + 1#
= 2 -#10 - 8#
= 2 -#1 * 2#
= 2 -#10 / 5#
= 2 -#12 % 5#
= 0 +

Operators

+

Arithmetic

+

1 + 1 = #1 + 1#

+

10 - 7 = #10 - 7#

+

15 * 10 = #15 * 10#

+

100 / 5 = #100 / 5#

+

120 % 5 = #120 % 5#

+

120 mod 5 = #120 mod 5#


-#1 eq 1#
-#15 neq 1#
-#10 gt 8#
-#1 lt 2#
-#10 gte 5#
-#1 lte 5#
+

Comparison

+

Standard Notation

+

Is 1 eq 1? #1 eq 1#

+

Is 15 neq 1? #15 neq 1#

+

Is 10 gt 8? #10 gt 8#

+

Is 1 lt 2? #1 lt 2#

+

Is 10 gte 5? #10 gte 5#

+

Is 1 lte 5? #1 lte 5#

+ +

Alternative Notation

+

Is 1 == 1? #1 eq 1#

+

Is 15 != 1? #15 neq 1#

+

Is 10 > 8? #10 gt 8#

+

Is 1 < 2? #1 lt 2#

+

Is 10 >= 5? #10 gte 5#

+

Is 1 <= 5? #1 lte 5#


+

Control Structures

+ + +

Condition to test for: "#myCondition#"

+ - #myCondition# + #myCondition#. We're testing. #myCondition#. Proceed Carefully!!! @@ -73,54 +101,53 @@ ColdFusion is a scripting language for web development.
+

Loops

+

For Loop

- #i#
+

Index equals #i#

+
+ +

For Each Loop (Complex Variables)

+ +

Set myArray3 to [5, 15, 99, 45, 100]

+ + + + +

Index equals #i#

+
+ +

Set myArray4 to ["Alpha", "Bravo", "Charlie", "Delta", "Echo"]

+ + + + +

Index equals #s#

+
+ +

Switch Statement

+ +

Set myArray5 to [5, 15, 99, 45, 100]

+ + + + + + +

#i# is a multiple of 5.

+
+ +

#i# is ninety-nine.

+
+ +

#i# is not 5, 15, 45, or 99.

+
+

```