From 1f68a9645573e54354d672709605ed9975e4843b Mon Sep 17 00:00:00 2001 From: wboka Date: Fri, 9 Oct 2015 08:43:12 -0400 Subject: [PATCH] Update coldfusion.html.markdown Adds conversion table and example of a very basic component. Adds a link to the official Adobe ColdFusion developer reference. --- coldfusion.html.markdown | 423 ++++++++++++++++----------------------- 1 file changed, 168 insertions(+), 255 deletions(-) diff --git a/coldfusion.html.markdown b/coldfusion.html.markdown index 6a9b69f0..e2f0737d 100644 --- a/coldfusion.html.markdown +++ b/coldfusion.html.markdown @@ -146,263 +146,176 @@ ColdFusion is a scripting language for web development.
+ +

Converting types

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ValueAs BooleanAs numberAs date-timeAs string
"Yes"TRUE1Error"Yes"
"No"FALSE0Error"No"
TRUETRUE1Error"Yes"
FALSEFALSE0Error"No"
NumberTrue if Number is not 0; False otherwise.NumberSee "Date-time values" earlier in this chapter.String representation of the number (for example, "8").
StringIf "Yes", True
If "No", False
If it can be converted to 0, False
If it can be converted to any other number, True
If it represents a number (for example, "1,000" or "12.36E-12"), it is converted to the corresponding number.If it represents a date-time (see next column), it is converted to the numeric value of the corresponding date-time object.
If it is an ODBC date, time, or timestamp (for example "{ts '2001-06-14 11:30:13'}", or if it is expressed in a standard U.S. date or time format, including the use of full or abbreviated month names, it is converted to the corresponding date-time value.
Days of the week or unusual punctuation result in an error.
Dashes, forward-slashes, and spaces are generally allowed.
String
DateErrorThe numeric value of the date-time object.DateAn ODBC timestamp.
+ +
+ +

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)