structKeyExists and null

can someone tell me what is going on here?

<cfset struct = {“itm1”:“sausages”,“itm2”:nullvalue()}>





This is Lucee 4.5.1.023 with null settings in admin unchanged from default.

I would have thought structkeyexists() should never be influenced by a
key’s value, whatever the value or whatever the null handling settings…

Regards

Richard

That’s incorrect. With ACF defaults for null handling, a struct key is considered not to exist if it’s a null value. If you need it to exist, turn on full null support.> On Oct 19, 2015, at 4:43 AM, Richard Meredith-Hardy <@Richard_Meredith-Har>

I would have thought structkeyexists() should never be influenced by a key’s value, whatever the value or whatever the null handling settings…

Regards

Richard


See Lucee at CFCamp Oct 22 & 23 2015 @ Munich Airport, Germany - Get your ticket NOW - http://www.cfcamp.org/

You received this message because you are subscribed to the Google Groups “Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/2429b8c6-b9f1-4a07-935c-000fedbd1024%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ok, thanks.

Having had to move stuff between ACF and another [better one] more than
once, I like to keep settings ‘stock’. In this case it’s easy to check a
key in a struct exists even if it has a null value with something like
listfind(structkeylist(my_struct),my_key)

but it nevertheless seems a bit illogical that structkeyExists() doesn’t do
it for you …

RichardOn Monday, 19 October 2015 11:56:05 UTC+1, Jon Clausen wrote:

That’s incorrect. With ACF defaults for null handling, a struct key is
considered not to exist if it’s a null value. If you need it to exist,
turn on full null support.

On Oct 19, 2015, at 4:43 AM, Richard Meredith-Hardy <r....@flymicro.com
<javascript:>>

I would have thought structkeyexists() should never be influenced by a
key’s value, whatever the value or whatever the null handling settings…

Regards

Richard


See Lucee at CFCamp Oct 22 & 23 2015 @ Munich Airport, Germany - Get your
ticket NOW - http://www.cfcamp.org/

You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+un...@googlegroups.com <javascript:>.
To post to this group, send email to lu...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/2429b8c6-b9f1-4a07-935c-000fedbd1024%40googlegroups.com
https://groups.google.com/d/msgid/lucee/2429b8c6-b9f1-4a07-935c-000fedbd1024%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.