Use this

<cfloop from="1" to="#ArrayLen( xmlcontent.message.items.item )#" index="x">
    <cfif NOT StructKeyExists( stWSSB_Tickler, x )>
        <cfset stWSSB_Tickler[x] = StructNew() />
    </cfif>
    <cfif ( NOT StructKeyExists( stWSSB_Tickler[x], 'tickler' ) )
            OR
            ( StructKeyExists( stWSSB_Tickler[x], 'tickler' ) AND
stWSSB_Tickler[x].tickler neq 'Y' )>
        <cfset stWSSB_Tickler[x].ord_qty =
xmlcontent.message.items.item[x].ord_qty.xmlText
/>
        <cfset stWSSB_Tickler[x].unit_price =
xmlcontent.message.items.item[x].unit_price.xmlText
/>
        <cfset stWSSB_Tickler[x].tickler = "Y" />
    </cfif>
</cfloop>

HTH

On 6/14/07, Che Vilnonis <[EMAIL PROTECTED]> wrote:
>
> I fixed my typo but I'm still getting errors with the code below. The
> error
> I now get reads: "Element 1 is undefined in a CFML structure referenced as
> part of an expression."
>
> I'm sure this is a simple fix... What am I missing?
>
>
> -----Original Message-----
> Basically, I have nested structures. I want to check if the nested
> structure
> exists first. If it does not exist, then I'll create it. Then I want to
> check if the nested structure's "tickler" value is "Y". Obviously, my cfif
> logic is not correct. Thanks!
>
> <cfif NOT isDefined("stWSSB_Tickler")>
>         <cfset stWSSB_Tickler = structNew()>
> </cfif>
>
> <cfloop from="1" to="#arrayLen(xmlcontent.message.items.item)#" index="x">
>
> <cfif NOT structIsEmpty(stWSSB_Tickler[x])>
>         <cfif structFind(stWSSB_Tickler[x], "tickler") NEQ "Y">
>
>                 <cfset stWSSB_Tickler[x] = structNew()>
>                 <cfset stWSSB_Tickler[x].ord_qty =
> xmlcontent.message.items.item[x].ord_qty.xmlText />
>                 <cfset stWSSB_Tickler[x].unit_price =
> xmlcontent.message.items.item[x].unit_price.xmlText />
>                 <cfset stWSSB_Tickler[x].tickler = "Y" />
>
>         </cfif>
>
> </cfif>
>
> </cfloop>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
CF 8 – Scorpio beta now available, 
easily build great internet experiences – Try it now on Labs
http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281148
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to