[cfaussie] Re: Cannot find key in struct.
structFind is used to determine is a structure has a key If you try and output "struct[key]" and the key doesn't exists that it will error I think maybe you have confused the meaning of your message :) -Original Message- From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Tuesday, 18 September 2007 10:04 PM To: cfaussie Subject: [cfaussie] Re: Cannot find key in struct. Hi Chris I've never quite understood why people use: structFind(struct, key) instead of just struct[key] ? I'm not sure if this would have any bearing on your issue, but it might be interesting to see the difference in behaviour. -- Adam --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: Cannot find key in struct.
Hi Chris I've never quite understood why people use: structFind(struct, key) instead of just struct[key] ? I'm not sure if this would have any bearing on your issue, but it might be interesting to see the difference in behaviour. -- Adam --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: Cannot find key in struct.
structKeyExists should be used to determine if a struct has a key. structFind determines if there is a value for a key in a struct. And it does NOT have much use IMHO. On 9/18/07, Steve Onnis <[EMAIL PROTECTED]> wrote: > > structFind is used to determine is a structure has a key > > If you try and output "struct[key]" and the key doesn't exists that it will > error > > I think maybe you have confused the meaning of your message :) > > -Original Message- > From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf > Of [EMAIL PROTECTED] > Sent: Tuesday, 18 September 2007 10:04 PM > To: cfaussie > Subject: [cfaussie] Re: Cannot find key in struct. > > > Hi Chris > I've never quite understood why people use: > > structFind(struct, key) > > instead of just > > struct[key] > > ? > > I'm not sure if this would have any bearing on your issue, but it might be > interesting to see the difference in behaviour. > > -- > Adam > > > > > > > > > -- === Raymond Camden, Camden Media Email: [EMAIL PROTECTED] Blog : www.coldfusionjedi.com AOL IM : cfjedimaster Keep up to date with the community: http://www.coldfusionbloggers.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: Cannot find key in struct.
> If you try and output "struct[key]" and the key doesn't exists that it will > error Sure. As with structFind(). Hence my question. > I think maybe you have confused the meaning of your message :) Maybe. Or maybe... not. -- Adam --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: Cannot find key in struct.
I use StructFind() a lot - simply because I tend to encapsulate struct's behind getter's and setters quite regualrly. So Inside a CFC you would find me writing: As ColdFusion doesn't support syntax like: Mark On 9/19/07, Adam Cameron <[EMAIL PROTECTED]> wrote: > > > If you try and output "struct[key]" and the key doesn't exists that it will > > error > > Sure. As with structFind(). > > Hence my question. > > > > I think maybe you have confused the meaning of your message :) > > Maybe. Or maybe... not. > > -- > Adam > > > > > -- E: [EMAIL PROTECTED] W: www.compoundtheory.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: Cannot find key in struct.
I tried this (with CF8): Key1 Exists: #StructKeyExists(myStruct, "key1")# Key2 Exists: #StructKeyExists(myStruct, "key2")# Key3 Exists: #StructKeyExists(myStruct, "key3")# Key4 Exists: #StructKeyExists(myStruct, "key4")# Keys: #StructKeyList(myStruct)# Output: Key1 Exists: YES Key2 Exists: NO Key3 Exists: NO Key4 Exists: NO Keys: KEY1,KEY2,key3,key4 So, the StructKeyExists() does not return "true" if the value is null (at least not with CF8) BUT, as you can see, the StructKeyList does indeed list the all the Keys regardless of their corresponding value. So maybe CF less then 8 behaves differently. /Max --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: Cannot find key in struct.
This has been a very interesting thread. But the truth of the matter is that it is depending on what you intend to do with the results. StructFind() : Will throw an exception error if the key doesn't exist. StructKeyExists() : will return Yes / no if the key exists or not. Struct["Key"] : Will also throw an exception if the key doesn't exist. Now you could always wrap a try/catch around most tags for exception handling, but this is an expensive way of doing things. Andrew Scott Senior Coldfusion Developer Aegeon Pty. Ltd. www.aegeon.com.au Phone: +613 8676 4223 Mobile: 0404 998 273 -Original Message- From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mark Mandel Sent: Wednesday, 19 September 2007 9:08 AM To: cfaussie@googlegroups.com Subject: [cfaussie] Re: Cannot find key in struct. I use StructFind() a lot - simply because I tend to encapsulate struct's behind getter's and setters quite regualrly. So Inside a CFC you would find me writing: As ColdFusion doesn't support syntax like: Mark On 9/19/07, Adam Cameron <[EMAIL PROTECTED]> wrote: > > > If you try and output "struct[key]" and the key doesn't exists that it will > > error > > Sure. As with structFind(). > > Hence my question. > > > > I think maybe you have confused the meaning of your message :) > > Maybe. Or maybe... not. > > -- > Adam > > > > > -- E: [EMAIL PROTECTED] W: www.compoundtheory.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Reminder: CFUG Melbourne - Tomorrow!!!!
All, I short reminder that tomorrow is the day for our local CFUG! We now have the ALL NEW BOARDROOM to have out meetings in. No more cramping into that old boardroom, with no air con! Location: NGA.net, Level 2, 17 Raglan St, South Melbourne Map: http://link.toolbot.com/google.com/73016 When: 20th September, Meeting starts at 7:00, so get there before hand (doors open at 6:30). Agenda: We have the venerable Robin Hilliard coming down to talk to use about using AIR in conjunction with SQL. One of the most exciting features recently added to the Adobe Integrated Runtime is support for SQL. In this presentation Robin will: - Show you how to use the flash.data API, - Cover what subset of SQL is supported, and - Give you an idea of the performance of the SQL engine. Robin Hilliard is founder and CEO of RocketBoots, a company providing consulting, training and software licensing services to teams working with Flash Platform technologies. He is an experienced software architect, with a particular focus on Adobe's Flex, ColdFusion, Flash and Flash Media Server products. Formerly with Allaire and Macromedia, Robin is a certified Flash and ColdFusion developer, an Adobe certified Master Flex Instructor and has a BSc in computer science and pure mathematics from Sydney University. Robin is based in Sydney, Australia. If you are going to attend, please RSVP to [EMAIL PROTECTED] Only those that RSVP are eligible for the door prizes, so make sure you apply! See the CFUG Melbourne Calendar at: http://www.cfcentral.com.au/Events/index.cfm Or add to your Google Calendar - search for 'CFUG Melbourne'. As per usual, we'll grab pizza during the evening, so we have something to scoff down! Look forward to seeing you all there. -- E: [EMAIL PROTECTED] W: www.compoundtheory.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Total Training Flex 2 Online Training courses, free 30 day trial
>From John Koch at Adobe. -- Hi everyone, Total Training is offering a 30 day free trial of their Flex 2 Online Trainings http://www.totaltraining.com/Store/online_adobe_login.aspx There is the Flex 2: Advanced Visual Programming course http://www.totaltraining.com/prod/outlines/adobe/flex2_avp.asp and the Flex 2: Rich Internet Applications course http://www.totaltraining.com/prod/outlines/adobe/flex2_ria.asp I thought the first chapters Flex 2: RIA course offered a good Flex introduction for beginners, and later chapters allow you to get into features that you may not have touched much before. Check it out, and please let your communities know about the offer. Thanks, John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: Cannot find key in struct.
That is very interesting, I would actually say that this is a bug then. The reason being is that Java, as I see it when defining something as NULL is telling you that it actually doesn't exist. Because come GC time it will be removed from the system quickly. However Coldfusion is obviously still setting the variable in the struct class object, and is saying the correct thing when checking if it exists, but the list of keys is wrong because it is held in the scope structure as being defined. Very interesting find if you ask me... Andrew Scott Senior Coldfusion Developer Aegeon Pty. Ltd. www.aegeon.com.au Phone: +613 8676 4223 Mobile: 0404 998 273 -Original Message- From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Maximilian Nyman Sent: Wednesday, 19 September 2007 10:59 AM To: cfaussie@googlegroups.com Subject: [cfaussie] Re: Cannot find key in struct. I tried this (with CF8): Key1 Exists: #StructKeyExists(myStruct, "key1")# Key2 Exists: #StructKeyExists(myStruct, "key2")# Key3 Exists: #StructKeyExists(myStruct, "key3")# Key4 Exists: #StructKeyExists(myStruct, "key4")# Keys: #StructKeyList(myStruct)# Output: Key1 Exists: YES Key2 Exists: NO Key3 Exists: NO Key4 Exists: NO Keys: KEY1,KEY2,key3,key4 So, the StructKeyExists() does not return "true" if the value is null (at least not with CF8) BUT, as you can see, the StructKeyList does indeed list the all the Keys regardless of their corresponding value. So maybe CF less then 8 behaves differently. /Max --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: Cannot find key in struct.
"The reason being is that Java, as I see it when defining something as NULL is telling you that it actually doesn't exist" Andrew, I beg to differ for me NULL tells me that it has uninitialized memory allocated to it. It has memory but no value. Coming from a Microsoft world, this is especially important if you're dealing with late verses early binding when creating and initializing objects. However if you try and use something that doesn't exist - that has no memory allocation - then it *should* throw an error. ColdFusion not having explicit NULL's is just muddying the issue. if it doesn't exist, it's not there. On 9/19/07, Andrew Scott <[EMAIL PROTECTED]> wrote: > > That is very interesting, I would actually say that this is a bug then. > > The reason being is that Java, as I see it when defining something as NULL > is telling you that it actually doesn't exist. Because come GC time it will > be removed from the system quickly. > > However Coldfusion is obviously still setting the variable in the struct > class object, and is saying the correct thing when checking if it exists, > but the list of keys is wrong because it is held in the scope structure as > being defined. > > Very interesting find if you ask me... > > > Andrew Scott > Senior Coldfusion Developer > Aegeon Pty. Ltd. > www.aegeon.com.au > Phone: +613 8676 4223 > Mobile: 0404 998 273 > > > > -Original Message- > From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf > Of Maximilian Nyman > Sent: Wednesday, 19 September 2007 10:59 AM > To: cfaussie@googlegroups.com > Subject: [cfaussie] Re: Cannot find key in struct. > > > I tried this (with CF8): > > > > > > > > > Key1 Exists: #StructKeyExists(myStruct, "key1")# > Key2 Exists: #StructKeyExists(myStruct, "key2")# > Key3 Exists: #StructKeyExists(myStruct, "key3")# > Key4 Exists: #StructKeyExists(myStruct, "key4")# > Keys: #StructKeyList(myStruct)# > > > Output: > Key1 Exists: YES > Key2 Exists: NO > Key3 Exists: NO > Key4 Exists: NO > Keys: KEY1,KEY2,key3,key4 > > So, the StructKeyExists() does not return "true" if the value is null > (at least not with CF8) > BUT, as you can see, the StructKeyList does indeed list the all the > Keys regardless of their corresponding value. So maybe CF less then 8 > behaves differently. > > > /Max > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: Cannot find key in struct.
Barry, That's my point, if something remains null come GC it's no longer available. In one instance, the StructKeyExists says no it doesn't exist this part is true. The other case StructKeyList, says that it does exist this part I believe is wrong. Because technically, no memory allocated means it doesn't exist as you stated. Andrew Scott Senior Coldfusion Developer Aegeon Pty. Ltd. www.aegeon.com.au Phone: +613 8676 4223 Mobile: 0404 998 273 -Original Message- From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Barry Beattie Sent: Wednesday, 19 September 2007 12:30 PM To: cfaussie@googlegroups.com Subject: [cfaussie] Re: Cannot find key in struct. "The reason being is that Java, as I see it when defining something as NULL is telling you that it actually doesn't exist" Andrew, I beg to differ for me NULL tells me that it has uninitialized memory allocated to it. It has memory but no value. Coming from a Microsoft world, this is especially important if you're dealing with late verses early binding when creating and initializing objects. However if you try and use something that doesn't exist - that has no memory allocation - then it *should* throw an error. ColdFusion not having explicit NULL's is just muddying the issue. if it doesn't exist, it's not there. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---