Skip to content

Instantly share code, notes, and snippets.

<cfscript>
writeDump(server);
</cfscript>
<cftry>
<cfoutput>Outer try starts.<br></cfoutput>
<cfset local.retval = {}>
<cfset local.retval.status = "">
<Cfset local.retval.message = "">
<!--- Inner cftry block --->
<cftry>
<cfoutput>Inner try starts.<br></cfoutput>
<cftry>
<cfset t = 100/10 * 3>
<cfdump var="#t#">
<cfcatch>
<cfdump var="#cfcatch#">
</cfcatch>
</cftry>
<cftry>
<cfset t = 100/10 * 3>
<cfdump var="#t#">
<cfcatch>
<cfdump var="#cfcatch#">
</cfcatch>
</cftry>
<cftry>
<cfset t = 100/10 * 3>
<cfdump var="#t#">
<cfcatch>
<cfdump var="#cfcatch#">
</cfcatch>
</cftry>
<cfscript>
x = [
{
"price": 20.00,
"status": "Active",
"postcodes": [
"CB1",
"CB11",
"CB2",
"CB22",
<cfset arguments.WebsiteAddress = "http://test.com">
<cfif len(trim(arguments.WebsiteAddress))
AND NOT reFindNoCase("^https?://", arguments.WebsiteAddress)>
<cfset arguments.WebsiteAddress = "http://" & trim(arguments.WebsiteAddress)>
</cfif>
<cfsavecontent variable="variables.apiResponse.fileContent">{
"id": 129,
"isLimited": false,
"isActive": true,
"cleanStatusId": 2,
"coverImage": null,
"roles": [
{
"roleId": 4,
"userId": 89
<cfscript>
/**
* Combines three numeric strings into a single 11-character string.
* @str1 max 5 digits (zero-padded)
* @str2 max 3 digits (zero-padded)
* @str3 exactly 3 digits
*/
public function buildDemoString(required string str1, required string str2, required string str3) {
// Validate lengths
if (len(arguments.str1) > 6) {
<cfscript>
private struct function splitTargetPath(required string targetPath, required array splittedSourcePath) {
local.splittedTargetPath = [];
local.indexPath = ""
local.startPos = 1;
for (local.token in arguments.splittedSourcePath) {
local.splitTokenLen = listLen(local.token.path, ".");
local.splitTokenPath = arrayToList(