That is correct for the key names in a struct that you create. However, the
OP was talking specifically about the keys in the ARGUMENTS struct. You
can't use array notation for those. :-)
On Wed, Nov 25, 2009 at 9:14 PM, denstar wrote:
I thought that using the bracket notation would keep
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
...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
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,
I said:
Adobe CF 8: each ARGUMENT key is uppercase (along with values)
should have said:
Adobe CF 8: each ARGUMENT key is uppercase (values are lowercase)
Cheers
--
Bryan Stevenson B.Comm.
VP Director of E-Commerce Development
Electric Edge Systems Group Inc.
phone: 250.480.0642
fax:
Love it or hate it, ColdFusion has, for as long as I can remember (v. 3?),
UPPERCASED variable names and struct keys. Since this is a known thing, you
can work around it by using either Lcase() or Ucase() where appropriate.
~|
I thought that using the bracket notation would keep case?
something[ThisThenLooksLikeThis]
vs something.THISTHENLOOKSLIKETHIS
I could be mixed up tho.
--
If you think in terms of a year, plant a seed; if in terms of ten
years, plant trees; if in terms of 100 years, teach the people.
: ARGUMENT scope case
I thought that using the bracket notation would keep case?
something[ThisThenLooksLikeThis]
vs something.THISTHENLOOKSLIKETHIS
I could be mixed up tho.
--
If you think in terms of a year, plant a seed; if in terms of ten
years, plant trees; if in terms of 100
The struct key name case should be retained with the following syntax:
cfset retStruct[success] = 1
2009/11/26 Bryan Stevenson br...@electricedgesystems.com
Hey All,
I just bumped into an interesting/annoying potential difference between
Adobe CF 8 and OpenBD.
When I run the following
9 matches
Mail list logo