This was done intentionally to match CF. This was a fix for NA bug #3039 which can be seen at:
http://www.newatlanta.com/c/auth/support/bluedragon/bugtracking/detail?bugId=3039 Note that since CF doesn't support the keyword null, this bug calls a java method that returns null in order to set a struct value to null. Paul -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Richard Taylor Sent: Monday, February 16, 2009 12:20 PM To: Open BlueDragon Subject: [OpenBD] null and StructKeyExists() Quick question on StructKeyExists() and its behavior with nulls. I just ran into a case that behaved a bit differently than I expected. I'm wondering if it's a bug or intentional. Basically if a struct has a key but the value of that key is null (a true, OpenBD null), StructKeyExists() returns false for that key. Is that correct? Here is a basic test case. Case 1: <cfset foo1 = structNew()> <cfset foo1.bar = null> <cfif StructKeyExists(foo1, "bar")> Correct <cfelse> Incorrect </cfif> <br/> Case 2: <cfset foo2 = structNew()> <cfset foo2.bar = ""> <cfif StructKeyExists(foo2, "bar")> Correct <cfelse> Incorrect </cfif> Output is: Case 1: Incorrect Case 2: Correct --~--~---------~--~----~------------~-------~--~----~ Open BlueDragon Public Mailing List http://groups.google.com/group/openbd?hl=en official site @ http://www.openbluedragon.org/ !! save a network - trim replies before posting !! -~----------~----~----~----~------~----~------~--~---
