Should you not be using structInsert(structure, key, value,
[allowOverwrite]) ?
Instead of <cfset mystruct[x] = otherstruct[x]>
i.e. structInsert(mystruct, x, evaluate("otherstruct." & x))
----- Original Message -----
From: "S. Isaac Dealey" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Monday, February 10, 2003 1:52 PM
Subject: array notation == unknown exception condition
> there is a rare condition in which CF 5 just hozes up a complex variable
(I
> think it only occurs with structures, but I'm not certain). I know in
> particular that this has happened with my code on several occasions
wherein
> if I use valid array notation for the structure, an unknown exception
> condition occurs, but if I use evaluate() to set the same variables, it
> works fine. At some point I remember reading on one of my mailing lists
> someone else mentioning having a problem with this same sort of thing
which
> apparently was a known bug, but not very common (and as a result not well
> documented).
>
> My first test case of this bug was this:
>
> pseudocode:
>
> <base template>
> <cf_manager>
> <cf_getvariables>
> <cfset mystruct = structnew()>
> <cfloop item="x" collection="#otherstruct#">
> <cfset mystruct[x] = otherstruct[x]></cfloop>
> <cfset caller.mystruct = mystruct>
> </cf_getvariables>
> <cfset caller.mystruct = mystruct>
> <cf_manager>
> <cfoutput>
> #structkeyexists(mystruct,x)# == true
> #issimplevalue(mystruct[x])# == false
> #issimplevalue(evaluate("mystruct." & x))# == true
> #mystruct.x# == [[ERROR UNKNOWN EXCEPTION CONDITION]]
> </cfoutput>
> </base template>
>
> The custom tags weren't using end-tag syntax -- the xml format is
convenient
> for the explanation of the problem.
>
> Currently I'm having a similar problem wherein the duplicate() function
> causes the unknown exception condition because the data is in a similar
> state.
>
> <cfoutput>
> #structkeyexists(mystruct,x)# == true
> #issimplevalue(mystruct[x])# == false
> #issimplevalue(evaluate("mystruct." & x))# == true
> <cfset temp = duplicate(mystruct)> == [[ERROR UNKNOWN EXCEPTION
CONDITION]]
> </cfoutput>
>
> I'm hoping that possibly someone on the list has a deeper understanding of
> the issue and what causes it. I know that in the past I've been able to
make
> this change from:
>
> <cfset mystruct[x] = otherstruct[x]>
>
> to
>
> <cfset mystruct[x] = evaluate("otherstruct.#x#")>
>
> and this has been an effective work-around. At the moment I'm at a loss to
> find a similar construct in the code, so I'm not sure how to isolate or
> debug the offending code. I know the duplicate() function isn't actually
the
> cause -- the cause is burried somewhere else in the code where the
structure
> I'm trying to duplicate is being created, but I can't seem to figure out
> where.
>
> Any insight is greatly appreciated,
>
> Thanks,
>
> s. isaac dealey 954-776-0046
>
> new epoch http://www.turnkey.to
>
> lead architect, tapestry cms http://products.turnkey.to
>
> tapestry api is opensource http://www.turnkey.to/tapi
>
> 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
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4