Daemonite: Smart Structs in CFMX preserve case in keynames Archive

Daemonite: Smart Structs in CFMX preserve case in keynames Archive


Wednesday, July 10, 2002
Smart Structs in CFMX preserve case in keynames

Had a weird issue in a CF5->CFMX app conversion. The javascript in one of the admin interfaces was failing. Turned out that the JS assumed that the structure keynames would all be UPPERCASE. It appears that CFMX preserves the casing in the keyname depending on how you declare the variable.

Try this snippet out for fun.

<cfscript>
a.b.cats = "Cats in hats.";
x.y.zapper = "Zap the zephyr.";
setVariable("a.b.LookAtTheCase", "See that the casing is preserved");
a.b['LookAtThisToo'] = "Again the casing is preserved";
a.b.x = x;
</cfscript>

<cfdump var="#a#">

Smart Structs in CFMX preserve case in keynames

Posted by modius at 06:18 PM | Permalink
Trackback: http://blog.daemon.com.au/cgi-bin/dmblog/mt-tb.cgi/1

Comments

Er... .. *scritches his head* That's a *WEIRD* thing!

Posted by: Todd on July 11, 2002 12:43 PM