From 1d43bd50c3e9305abfe95eade590ef5828f9ad5c Mon Sep 17 00:00:00 2001 From: wboka Date: Mon, 5 Oct 2015 12:29:08 -0400 Subject: Initial placeholder --- coldfusion.html.markdown | 1 + 1 file changed, 1 insertion(+) create mode 100644 coldfusion.html.markdown (limited to 'coldfusion.html.markdown') diff --git a/coldfusion.html.markdown b/coldfusion.html.markdown new file mode 100644 index 00000000..3c0b0b06 --- /dev/null +++ b/coldfusion.html.markdown @@ -0,0 +1 @@ +Coming soon -- cgit v1.2.3 From 9d33f091701013236055b553d7eb7a8dba3df65e Mon Sep 17 00:00:00 2001 From: wboka Date: Mon, 5 Oct 2015 16:52:07 -0400 Subject: Update coldfusion.html.markdown Adds variable declaration, comparison operators, and if/else control structures --- coldfusion.html.markdown | 395 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 394 insertions(+), 1 deletion(-) (limited to 'coldfusion.html.markdown') diff --git a/coldfusion.html.markdown b/coldfusion.html.markdown index 3c0b0b06..4c734920 100644 --- a/coldfusion.html.markdown +++ b/coldfusion.html.markdown @@ -1 +1,394 @@ -Coming soon +--- +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 +" ---> + + + + + + + + + + +#myVariable# +#myNumber# + + + + + + + + + + + + + +#1 + 1# = 2 +#10 - 8# = 2 +#1 * 2# = 2 +#10 / 5# = 2 +#12 % 5# = 0 + + +#1 eq 1# +#15 neq 1# +#10 gt 8# +#1 lt 2# +#10 gte 5# +#1 lte 5# + + + + + #myCondition# + + #myCondition#. Proceed Carefully!!! + + myCondition is unknown + +``` + + +## Further Reading + +The links provided here below are just to get an understanding of the topic, feel free to Google and find specific examples. -- cgit v1.2.3 From 1e7f639755042211ce0f10953153d6d341dbecab Mon Sep 17 00:00:00 2001 From: wboka Date: Mon, 5 Oct 2015 16:52:47 -0400 Subject: Update coldfusion.html.markdown Fixes a typo --- coldfusion.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'coldfusion.html.markdown') diff --git a/coldfusion.html.markdown b/coldfusion.html.markdown index 4c734920..be08733e 100644 --- a/coldfusion.html.markdown +++ b/coldfusion.html.markdown @@ -26,7 +26,7 @@ ColdFusion is a scripting language for web development. #myVariable# -#myNumber# +#myNumber# -- cgit v1.2.3 From b8ad751cc020c07796832c1689cca7b84970b4e9 Mon Sep 17 00:00:00 2001 From: wboka Date: Mon, 5 Oct 2015 21:07:13 -0400 Subject: Update coldfusion.html.markdown Adds a few more examples --- coldfusion.html.markdown | 87 ++++++++++++++++++++---------------------------- 1 file changed, 37 insertions(+), 50 deletions(-) (limited to 'coldfusion.html.markdown') diff --git a/coldfusion.html.markdown b/coldfusion.html.markdown index be08733e..b8fe9359 100644 --- a/coldfusion.html.markdown +++ b/coldfusion.html.markdown @@ -10,9 +10,9 @@ ColdFusion is a scripting language for web development. ```ColdFusion " ---> - @@ -25,8 +25,10 @@ ColdFusion is a scripting language for web development. -#myVariable# -#myNumber# +#myVariable#
+#myNumber#
+ +
@@ -40,19 +42,23 @@ ColdFusion is a scripting language for web development. -#1 + 1# = 2 -#10 - 8# = 2 -#1 * 2# = 2 -#10 / 5# = 2 -#12 % 5# = 0 +#1 + 1#
= 2 +#10 - 8#
= 2 +#1 * 2#
= 2 +#10 / 5#
= 2 +#12 % 5#
= 0 + +
-#1 eq 1# -#15 neq 1# -#10 gt 8# -#1 lt 2# -#10 gte 5# -#1 lte 5# +#1 eq 1#
+#15 neq 1#
+#10 gt 8#
+#1 lt 2#
+#10 gte 5#
+#1 lte 5#
+ +
@@ -63,36 +69,17 @@ ColdFusion is a scripting language for web development. myCondition is unknown -``` - + + #i#
+
+ +
+``` +" ---> - +

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.

+
+

``` +

Components

+ +Code for reference (Functions must return something to support IE) + +
+<cfcomponent>
+	<cfset this.hello = "Hello" />
+	<cfset this.world = "world" />
+
+	<cffunction name="sayHello">
+		<cfreturn this.hello & ", " & this.world & "!" />
+	</cffunction>
+	
+	<cffunction name="setHello">
+		<cfargument name="newHello" type="string" required="true" />
+		
+		<cfset this.hello = arguments.newHello />
+		 
+		<cfreturn true />
+	</cffunction>
+	
+	<cffunction name="setWorld">
+		<cfargument name="newWorld" type="string" required="true" />
+		
+		<cfset this.world = arguments.newWorld />
+		 
+		<cfreturn true />
+	</cffunction>
+	
+	<cffunction name="getHello">
+		<cfreturn this.hello />
+	</cffunction>
+	
+	<cffunction name="getWorld">
+		<cfreturn this.world />
+	</cffunction>
+</cfcomponent>
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +sayHello() +

#sayHello()#

+getHello() +

#getHello()#

+getWorld() +

#getWorld()#

+setHello("Hola") +

#setHello("Hola")#

+setWorld("mundo") +

#setWorld("mundo")#

+sayHello() +

#sayHello()#

+getHello() +

#getHello()#

+getWorld() +

#getWorld()#

+``` ## Further Reading The links provided here below are just to get an understanding of the topic, feel free to Google and find specific examples. + +1. [Coldfusion Reference From Adobe](https://helpx.adobe.com/coldfusion/cfml-reference/topics.html) -- cgit v1.2.3