Sorry I made a mistake in the first snippet. Should be:

<cfset FORM.allidslist_new = FORM.allidslist>
 <cfloop index = "VotedElement" list = "#FORM.vote#">
    <cfset position = ListFind(FORM.allidslist_new, VotedElement )>
        <cfif position>
         <cfset  FORM.allidslist_new =  ListDeleteAt(FORM.allidslist_new,
position)>
    </cfif>
</cfloop>

Dom

On 06/07/07, Dominic Watson <[EMAIL PROTECTED]> wrote:
>
> When you call ListDeleteAt() you do not change the value of the first
> argument (FORM.allidslist) so each iteration of your loop starts again
> with the full list of IDs.
>
> Do this instead if you want to use that 3rd form variable:
>
> <cfloop index = "VotedElement" list = "#FORM.vote#">
>     <cfset position = ListFind(FORM.allidslist, VotedElement )>
>     <cfset FORM.allidslist_new = FORM.allidslist>
>     <cfif position>
>          <cfset  FORM.allidslist_new =  ListDeleteAt(FORM.allidslist_new,
> position)>
>     </cfif>
> </cfloop>
>
> Or alternernatively and I think preferrably:
>
> <cfset aAll = ListToArray(FORM.allidslist)>
> <cfset aVoted = ListToArray(FORM.voted)>
> <cfset aAll.RemoveAll(aVoted)>
> <cfset FORM.allidslist_new = ArrayToList(aAll)>
>
> Dominic
>
>
>
> On 06/07/07, coldfusion. developer @ att. net coldfusion. developer @ att.
> net <[EMAIL PROTECTED] > wrote:
> >
> > correction ... first 8 next to FORM.allidslist_new was missing.
> >
> > #FORM.vote# = 8,9,12
> > FORM.allidslist = 8,9,12,13,14,15,16,17,18,19,20,21,22,23,24
> > FORM.allidslist_new = 8,9,13,14,15,16,17,18,19,20,21,22,23,24
> >
> > 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP

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

Reply via email to