Shaun Mccran

My digital playground

13
O
C
T
2009

ColdFusion structures and case sensitivity examples

Having been using Flex a little more recently I stumbled upon an old issue that I had previously addressed, but it had become second nature, and so I had forgotten about having to learn a workaround in the past. Passing objects from ColdFusion to Flex can be tricky at times, especially as ColdFusion is generally not case sensitive, but Flex is, and this can lead to problems.

I had previously found that how you build your Structure will have an impact the case of the keys. Example one is a Structure built using the traditional dot notation, in a CF 7 and below method:

view plain print about
1<cfscript>
2    newStruct = structNew();
3    newStruct.starter = "Prawn Salad";
4    newStruct.maincourse = "Roast Chicken";
5    newStruct.desert = "Apple Pie";
6
</cfscript>
7
8<cfdump var="#newStruct#" label="Dot notation">

This is the older way of building a Structure, notice how all the keys are uppercase.

The second example is very similar, except that it is using associative array notation, IE brackets to denote the key values, rather than dot notation.

view plain print about
1<cfscript>
2    newStruct = structNew();
3    newStruct["starter"] = "Prawn Salad";
4    newStruct["maincourse"] = "Roast Chicken";
5    newStruct["desert"] = "Apple Pie";
6
</cfscript>
7
8<cfdump var="#newStruct#" label="Struct notation">

Since I originally looked at this ColdFusion 8 (and now 9!) have been released. ColdFusion 8 introduced a new way of creating structures, what casing does this use?

view plain print about
1<cfset newStruct = {
2    starter = "Prawn Salad",
3    maincourse = "Roast Chicken",
4    desert = "Apple Pie"
5} /
>

6
7<cfdump var="#newStruct#" label="CF 8 method">

It also creates an uppercase structure. I haven't really played around with this method enough to see if there is another way of creating a lowercase structure, so for now I'll be sticking to the older associative array method of creating my structures. That way they are easily transferred as a Flex object.

TweetBacks
Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
todd sharp's Gravatar Have a look here:

http://help.adobe.com/en_US/ColdFusion/9.0/Develop...

Also - FYI - struct["key"] is known as 'associative array' notation.
# Posted By todd sharp | 13/10/09 13:56
Shaun McCran's Gravatar Thanks for the heads up on the terminology, I thought it had a more distinctive naming convention, couldn't for the life of my remember what it was.

In terms of setting the casing at server level (as per your link) I'm much more of a fan of controlling the code base 'in code', and leaving the server config as vanilla as possible, but that is probably because I've mostly been working on shared hosting platforms, and generally don't have access to things like the 'gateway-config.xml'.
# Posted By Shaun McCran | 15/10/09 10:00
breast enlargement sydney's Gravatar Having been using Flex a little more recently I stumbled upon an old issue that I had previously addressed, but it had become second nature, and so I had forgotten about having to learn a workaround in the past. Passing objects from ColdFusion to Flex can be tricky at times, especially as ColdFusion is generally not case sensitive, but Flex is, and this can lead to problems.
# Posted By breast enlargement sydney | 03/10/15 07:06
drug treatment 's Gravatar I want you to thank for your time of this wonderful read!!! I definitely enjoy every little bit of it and I have you bookmarked to check out new stuff of your blog a must read blog!
# Posted By drug treatment  | 07/10/15 05:49
seo marketing's Gravatar Thanks for the heads up on the terminology, I thought it had a more distinctive naming convention, couldn't for the life of my remember what it was.
# Posted By seo marketing | 12/10/15 02:31
blastocystis hominis's Gravatar I had previously found that how you build your Structure will have an impact the case of the keys. Example one is a Structure built using the traditional dot notation, in a CF 7 and below method...
# Posted By blastocystis hominis | 31/10/15 01:36
how to lose weight's Gravatar I haven't really played around with this method enough to see if there is another way of creating a lowercase structure, so for now I'll be sticking to the older associative array method of creating my structures. That way they are easily transferred as a Flex object.
# Posted By how to lose weight | 31/10/15 23:17
Build My List 20's Gravatar I suspect you are right that the 80% rate I was boasting of is for registered voters.
# Posted By Build My List 20 | 05/11/15 22:39
cheapessayswriters's Gravatar The question tends to derive the designer to reach the best design at the shortest time and transfer
# Posted By cheapessayswriters | 11/11/15 01:06
original site's Gravatar I see these days don't really provide anything that I'm interested in, but I'm most definately interested in this one.
# Posted By original site | 11/11/15 22:58
Plagiarism Checker Apps's Gravatar I see these days don’t really provide anything that I’m interested in, but I’m most definately interested in this one.
# Posted By Plagiarism Checker Apps | 12/11/15 02:13
proxy servers's Gravatar I really appreciate the time and your effort you put to it.
# Posted By proxy servers | 15/11/15 22:39
cccam server's Gravatar In terms of setting the casing at server level (as per your link) I'm much more of a fan of controlling...
# Posted By cccam server | 16/11/15 04:49
dofollow seo backlink services's Gravatar This book, which revisits the relationship between Canada and the United States, is an in-depth volume for understanding the numerous dimensions and complexities...
# Posted By dofollow seo backlink services | 19/11/15 21:55
Local Plumbers's Gravatar Example one is a Structure built using the traditional dot notation, in a CF 7 and below method:
# Posted By Local Plumbers | 22/11/15 00:59
venus factor diet youtube's Gravatar Example one is a Structure built using the traditional dot notation, in a CF 7 and below method:
# Posted By venus factor diet youtube | 25/11/15 00:32
delhi to jaipur cab's Gravatar I definitely enjoy every little bit of it and I have you bookmarked to check out new stuff of your blog a must read blog!
# Posted By delhi to jaipur cab | 29/11/15 03:58
best backlink gig fiverr.com's Gravatar RAW is a performance piece that pushes the boundaries of human capabilities and challenges extreme human ability to attain flight....
# Posted By best backlink gig fiverr.com | 02/12/15 23:03
facebook likes's Gravatar Your website is really cool and this is a great inspiring article. Thank you so much.
# Posted By facebook likes | 14/12/15 23:45
youtube views's Gravatar Thanks for sharing the info, keep up the good work going.... I really enjoyed exploring your site. good resource...
# Posted By youtube views | 14/12/15 23:46
ringing in ears's Gravatar This is an excellent post I seen thanks to share it. It is really what I wanted to see hope in future you will continue for sharing such a excellent post...
# Posted By ringing in ears | 16/12/15 20:53
pure garcinia cambogia's Gravatar I see these days don't really provide anything that I'm interested in, but I'm most definately interested in this one.
# Posted By pure garcinia cambogia | 16/12/15 23:33
sioux south dakota's Gravatar I've just decided to create a blog, which I have been wanting to do for a while. Thanks for this post, it's really useful
# Posted By sioux south dakota | 17/12/15 01:01
buy instagram followers's Gravatar which revisits the relationship between Canada and the United States, is an in-depth volume for understanding the numerous dimensions and complexities...
# Posted By buy instagram followers | 18/12/15 21:15
American Xarelto Lawyers's Gravatar Good post but I was wondering if you could write a little more on this subject? I’d be very thankful if you could elaborate a little bit further.
# Posted By American Xarelto Lawyers | 18/12/15 21:57
cccam server's Gravatar I want you to thank for your time of this wonderful read!!! I definitely enjoy every little bit of it and I have you bookmarked to check out new stuff of your blog a must read blog....
# Posted By cccam server | 18/12/15 23:44
blog commenting reviews's Gravatar The odd thing is that the Spurs were never one of the teams...
# Posted By blog commenting reviews | 19/12/15 02:43
Medtech's Gravatar Great Post This is also a very good post which I really enjoyed reading. It is not everyday that I have the possibility to see something like this..Thank You!
# Posted By Medtech | 20/12/15 21:47
term papers for sale's Gravatar Firstly create a CurrencyFormatter object, and specify the currency symbol, and any other formatting parameters that you require.
# Posted By term papers for sale | 25/12/15 22:02
check this out's Gravatar I m glad reading your article. But should remark on some general things. The web site style is perfect. the articles is really great...
# Posted By check this out | 27/12/15 22:05
check this out's Gravatar I found this is an informative and interesting post so i think so it is very useful and knowledgeable. I would like to thank you for the efforts you have made in writing this article..
# Posted By check this out | 28/12/15 21:51
web traffic's Gravatar I read a lot of stuff and i found that the way of writing to clearing that exactly want to say was very good so i am impressed and i like to come again in future....
# Posted By web traffic | 29/12/15 22:02
buy youtube video likes's Gravatar I read a lot of stuff and i found that the way of writing to clearing that exactly want to say was very good so i am impressed and i like to come again in future....
# Posted By buy youtube video likes | 30/12/15 22:15
high pr backlinks's Gravatar I want you to thank for your time of this wonderful read!!! I definitely enjoy every little bit of it and I have you bookmarked to check out new stuff of your blog a must read blog!
# Posted By high pr backlinks | 04/01/16 21:45
dot sleep apnea compliance's Gravatar It was a wonderful chance to visit this kind of site and I am happy to know. thank you so much for giving us a chance to have this opportunity...
# Posted By dot sleep apnea compliance | 06/01/16 21:50
office fitouts sydney's Gravatar It was a wonderful chance to visit this kind of site and I am happy to know. thank you so much for giving us a chance to have this opportunity...
# Posted By office fitouts sydney | 07/01/16 02:10
amazon seller account's Gravatar I have feel that this blog is really have all those quality that qualify a blog to be a one.I wanted to leave a little comment to support you and wish you a good continuation.
# Posted By amazon seller account | 08/01/16 22:47
Beverly Hills $1 Billion Vineyard's Gravatar I thought it was going to be some boring old post, but it really compensated for my time. I will post a link to this page on my blog. I am sure my visitors will locate that extremely useful...
# Posted By Beverly Hills $1 Billion Vineyard | 11/01/16 01:11
Kraut's Gravatar Good post but I was wondering if you could write a little more on this subject? I’d be very thankful if you could elaborate a little bit further..
# Posted By Kraut | 17/01/16 22:03
Back to top