On Thu, Jul 17, 2008 at 11:42 AM, Kenny Kinds <[EMAIL PROTECTED]> wrote:

>
> Here's a sample of the list getting passed from the form
>
> ACIS---Midwest'CAMPS---Midwest'CAMPS12345678901234X---Midwest123456789012Y'SORD---Southwest'SORD---West'SUPPORT---ChangeMan'SUPPORT---MVS
> Support'WBS---Midwest
>
> but this is the only value i'm getting after the loop
> WBS---Midwest. (this would be the listElement value in my original code)
>

you can loop over that original list using - as the delimiter.  cf will
ignore the "empty" list elements so you're safe there.

<cfset myList =
"ACIS---Midwest'CAMPS---Midwest'CAMPS12345678901234X---Midwest123456789012Y'SORD---Southwest'SORD---West'SUPPORT---ChangeMan'SUPPORT---MVS
Support'WBS---Midwest" />

<cfoutput>
    <cfloop list="#myList#" index="listElement" delimiters="-">
        #listElement#<br />
    </cfloop>
</cfoutput>

inside the first loop, you can check the listLen() of each list element
using the single quote as the delimiter.

<cfoutput>
    <cfloop list="#myList#" index="listElement" delimiters="-">
        <cfif listLen(listElement, "'") gt 1>
             first: #listFirst(listElement, "'")# second:
#listLast(listElement, "'")#<br />
        <cfelse>
             single list element: #listElement#<br />
        </cfif>
    </cfloop>
</cfoutput>



-- 
A byte walks into a bar and orders a pint. Bartender asks him "What's
wrong?" Byte says "Parity error." Bartender nods and says "Yeah, I thought
you looked a bit off."


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:309251
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