> You should replace:
> StructIsEmpty(newsbank.collection.nbx[newsNum].HEADERFIELD
> S.SHL)
> With:
> NOT (StructKeyExists(newsbank.collection.nbx[newsNum].HEAD
> ERFIELDS,
> "SHL") AND NOT
> StructIsEmpty(newsbank.collection.nbx[newsNum].HEADERFIELD
> S.SHL))
I don't think this short-circuit it quite right ... ( though it's easier to
see when the variable names are shorter ) ... what I'm reading is
NOT (StructKeyExists(mystruct,"mykey")
AND NOT StructIsEmpty(mystruct.mykey))
I suspect, what you really want is the reverse, since this will check to see
if the key exists and then attempt to read the key whether it exists or not,
which will produce an error if it doesn't exist. So I suspect you're looking
for this:
<cfif StructKeyExists(mystruct,"mykey")
AND NOT StructIsEmpty(mystruct.mykey)>
It's that extra NOT and () that I suspect will get you...
Or possibly:
<cfparam name="mystruct.mykey" type="structure" default="#structnew()#">
<cfif not structisempty(mystruct.mykey)>
> I've also tried <cfparam>ing
> newsbank.collection.nbx[newsNum].HEADERFIELDS.SHL.VALUE,
> and CF spits
> back profanity at me for that one as well.
There's usually a way to change the syntax to make something like this work
If NewsNum is actually a number, you're not going to be able to get away
with
<cfparam name="newsbank.collection.nbx.#newsnum#.headerfields.shl.value"
..>
Oh -- you might (probably) ought to param shl before you param shl.value ...
If NewsNum is actually a number, you should copy that structure to a local
variable, as James suggested -- makes things easier and helps you avoid
syntactical traps like the param above:
<cfset shortnews = newsbank.collection.nbx[newsnum]>
<cfparam name="shortnews.headerfields.shl" type="struct"
default="#structnew()#">
hth
s. isaac dealey 954-776-0046
new epoch http://www.turnkey.to
lead architect, tapestry cms http://products.turnkey.to
certified advanced coldfusion 5 developer
http://www.macromedia.com/v1/handlers/index.cfm?ID=21816
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com