--- language: ColdFusion contributors: - ["Wayne Boka", "http://wboka.github.io"] filename: LearnColdFusion.cfm --- 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

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

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#


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#. We're testing. #myCondition#. Proceed Carefully!!! myCondition is unknown

Loops

For Loop

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.


``` ## Further Reading The links provided here below are just to get an understanding of the topic, feel free to Google and find specific examples.