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 !!
-~----------~----~----~----~------~----~------~--~---

Reply via email to