Skip to content

Instantly share code, notes, and snippets.

<cfset usersQuery = QueryNew("cn")>
<cfset QueryAddRow(usersQuery, 1)>
<cfset QuerySetCell(usersQuery, "cn", "bob")>
<cfset QueryAddRow(usersQuery, 1)>
<cfset QuerySetCell(usersQuery, "cn", "joe")>
<cfset QueryAddRow(usersQuery, 1)>
<cfset QuerySetCell(usersQuery, "cn", "dave")>
<cfdump var="usersQuery">
<cfscript>
// CFScript version
var objDto = {
"zuzu": "string",
"opa": "string",
"nome": "string",
}
writedump(objDto);
<cfscript>
// create the query with safe col names
qry = QueryNew("test_test,colTwo");
queryaddrow( qry );
querysetcell( qry, "test_test", 123 );
querysetcell( qry, "colTwo", "abc" );
qry.setColumnNames(["test test","colTwo"]);
<!-- Input Form -->
<form action="processNumber.cfm" method="post">
Enter the number: <input type="text" name="num">
<input type="submit" value="Submit">
</form>
<!-- Processing the Input -->
<!--<cfif CGI.REQUEST_METHOD EQ 'POST'></cfif>-->
<cfif StructKeyExists(form, "num") AND Len(form.num) GT 0>
<cfset num = Val(form.num)> <!-- Convert input to numeric -->
<cfscript>
runs = [
{ totalDuration: 10},
{ totalDuration: 20},
{ totalDuration: 30}
];
//dump(runs);
arraySort(
<cfscript>
runs = [
{ totalDuration: 10},
{ totalDuration: 20},
{ totalDuration: 30}
];
//dump(runs);
arraySort(
<cfscript>
runs = [
{ totalDuration: 10},
{ totalDuration: 20},
{ totalDuration: 30}
];
dump(runs);
arraySort(
<cfscript>
private struct function getBlankRateBodyStruct() output = "false" hint = "return default rate body struct" {
var jsonString = {
"RateRequest": {
"Request": {
"TransactionReference": {
"CustomerContext": ""
}
<cfscript>
private struct function getBlankRateBodyStruct() output = "false" hint = "return default rate body struct" {
var jsonString = {
"RateRequest": {
"Request": {
"TransactionReference": {
"CustomerContext": "CustomerContext"
}