Here is a quick guide to all the different kinds of structs in ColdFusion
<cfscript>
// plain old struct
a = {};
a.b = “Bunny”;
a.c = “Canary”;
a.d = “Doggy”;
a.append({“a” : “Apple”});
a.append({“f” : “Frog”});
writedump(a);
// ordered
a = [:];
a.b = “Bunny”;
a.c = “Canary”;
a.d = “Doggy”;
a.append({“a” : “Apple”});
a.append({“f” : “Frog”});
writedump(a);
// sorted
a = StructNew(“ordered”, “text”);
a.b = “Bunny”;
a.c = “Canary”;
a.d = “Doggy”;
a.append({“a” : “Apple”});
a.append({“f” : “Frog”});
writedump(a);
</cfscript>
Which results in
See:
The post Quick thoughts on structs appeared first on ColdFusion.