This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfset test = ""> | |
<cfdump var="#DateFormat(test, "dd.mm.yyyy")#"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
myStruct = {}; | |
myStruct[ 1 ] = { "iso" : "de", "dir" : true, "label" : "Englisch" }; | |
myStruct[ 2 ] = { "iso" : "de", "dir" : true, "label" : "Deutsch" }; | |
myStruct[ 3 ] = { "iso" : "de", "dir" : true, "label" : "Französische" }; | |
result = SerializeJSON( myStruct ); | |
writeDump( result ); | |
</cfscript> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
myStruct = {}; | |
myStruct[ 1 ] = { "iso" : "de", "dir" : true, "label" : "Englisch" }; | |
myStruct[ 2 ] = { "iso" : "de", "dir" : true, "label" : "Deutsch" }; | |
myStruct[ 3 ] = { "iso" : "de", "dir" : true, "label" : "Französische" }; | |
result = SerializeJSON( myStruct ); | |
writeDump( result ); | |
</cfscript> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
xmlObj = xmlParse( '<Ortus><Products></Products></Ortus>' ); | |
products = [ "BoxLang", "CommandBox" ]; | |
root = xmlObj.xmlRoot.Products.xmlChildren; | |
for( i = 1; i <= products.len(); i++ ){ | |
product = xmlElemNew( xmlObj, "Product" ); | |
product.xmlText = products[ i ]; | |
// Below will pass when uncommented | |
// xmlObj.xmlRoot.Products.xmlChildren.append( product ); | |
xmlObj.xmlRoot.Products.xmlChildren[ i ] = product; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfset test = xmlNew()> | |
<cfdump var="#test#"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfset myArray = ArrayNew(2)> | |
<cfset ArrayAppend(myArray, "Apple")> | |
<cfset ArrayAppend(myArray, "Banana")> | |
<cfoutput> | |
<cfloop from="1" to="#ArrayLen(myArray)#" index="i"> | |
#myArray[i]#<br> | |
</cfloop> | |
</cfoutput> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfoutput> | |
<cfset combineRatings[3] = 1; | |
]> | |
<cfloop array="#combineRatings#" index="ratingArray"> | |
</cfloop> | |
<cfdump var = "#combineratings#"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfset arr = ";ROOF;1266;;Roof;;;INACTIVE"> | |
<cfset EMPTY =''> | |
<!--- Manually replace semicolons to ensure each semicolon creates a split point, including empty values ---> | |
<cfset arr = replace(arr, ";", "#EMPTY#", "ALL")> | |
<!--- Now split by the placeholder #EMPTY# to keep empty values ---> | |
<cfset arrList = listToArray(arr, "#EMPTY#")> | |
<!--- Output the array length and the values ---> | |
<cfoutput> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfset arr = ";ROOF;1266;;Roof;;;INACTIVE"> | |
<!--- Manually replace semicolons to ensure each semicolon creates a split point, including empty values ---> | |
<cfset arr = replace(arr, ";", "EMPTY", "ALL")> | |
<!--- Now split by the placeholder #EMPTY# to keep empty values ---> | |
<cfset arrList = listToArray(arr, "#EMPTY#")> | |
<!--- Output the array length and the values ---> | |
<cfoutput> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfset arr = ";ROOF;1266;;Roof;;;INACTIVE"> | |
<cfset Empty = 'empty'> | |
<!--- Replace semicolons with a unique placeholder to handle empty values correctly ---> | |
<cfset arr = replace(arr, ";", "#EMPTY#", "ALL")> | |
<!--- Split the string by the placeholder instead of semicolons ---> | |
<cfset arrList = listToArray(arr, "EMPTY")> | |
<!--- Output the array length (should now be 8) ---> | |
<cfoutput> |
NewerOlder