...and Dominic wins the prize!! Thanks all for the info. Dominic's collection loop solves the CF variable scope structure key case problem (although a PITA whenn it needs to be done).
Of course since posting I have realized that in most cases I do NOT need to return CF variable scopes via AJAX and will generally return just the retStruct you saw in my example code with simple values and not structures. So in the more widely used case I will have the control over structure key case at the time I create the struct and its keys. So thanks also to those that mentioned array notation as a way to preserve case without the explicit use of lCase(). That said I should say that the key case is already being preserved the long way I wrote my sample code....just FYI ;-) Happy almost US bird day for those below the 49th ;-) Cheers -- Bryan Stevenson B.Comm. VP & Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: [email protected] web: www.electricedgesystems.com Notice: This message, including any attachments, is confidential and may contain information that is privileged or exempt from disclosure. It is intended only for the person to whom it is addressed unless expressly authorized otherwise by the sender. If you are not an authorized recipient, please notify the sender immediately and permanently destroy all copies of this message and attachments. On Thu, 2009-11-26 at 09:23 +0000, Dominic Watson wrote: > Trouble is, he needs to dump in the entire arguments scope, regardless of > what's in it (going by the example code). This should do the trick: > > <cfset var arg = "" /> > ... > ... > <cfloop collection="#arguments#" item="arg"> > <cfset retStruct['output'][LCase(arg)] = arguments[arg] /> > </cfloop> > > HTH, > > Dom > > 2009/11/26 Kevan Stannard <[email protected]> > > > > > The struct key name case should be retained with the following syntax: > > > > <cfset retStruct["success"] = "1"> > > > > > > > > 2009/11/26 Bryan Stevenson <[email protected]> > > > > > > > > Hey All, > > > > > > I just bumped into an interesting/annoying potential difference between > > > Adobe CF 8 and OpenBD. > > > > > > When I run the following code in a CFFUNCTION: > > > > > > <!--- define the structure---> > > > <cfset var retStruct = StructNew()> > > > > > > <cfset structInsert(retStruct, "success", "1")> > > > <cfset structInsert(retStruct, "output", #ARGUMENTS#)> > > > <cfset structInsert(retStruct, "exception", "")> > > > > > > I get the following results: > > > > > > OpenBD: each ARGUMENT key is lowercase (along with values) > > > > > > Adobe CF 8: each ARGUMENT key is uppercase (along with values) > > > > > > This is a royal PITA for JS that uses the retStruct (json serialized BTW > > > by ajaxCFC and not serializeJSON()). All my JS code is lowercase. > > > > > > Anyways.....I'm sure there is a simple solution to force lowercase > > > ARGUMENT scope structure keys, but I'm a few days into a nasty head cold > > > and the noodle isn't multi-tasking right now ;-) > > > > > > TIA > > > > > > Cheers > > > > > > -- > > > > > > Bryan Stevenson B.Comm. > > > VP & Director of E-Commerce Development > > > Electric Edge Systems Group Inc. > > > phone: 250.480.0642 > > > fax: 250.480.1264 > > > cell: 250.920.8830 > > > e-mail: [email protected] > > > web: www.electricedgesystems.com > > > > > > Notice: > > > This message, including any attachments, is confidential and may contain > > > information that is privileged or exempt from disclosure. It is intended > > > only for the person to whom it is addressed unless expressly authorized > > > otherwise by the sender. If you are not an authorized recipient, please > > > notify the sender immediately and permanently destroy all copies of this > > > message and attachments. > > > > > > > > > > > > > > > > > > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328731 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

