On 4/5/07, Scott Stewart <[EMAIL PROTECTED]> wrote:
> Hey All,
> I have a cfloop over a semi colon delimited list
>
> "Blah; yadda; whatever"
>
> <cfloop list="#Record.indexTerms#" index="thisTerm" delimiters=";">
>
> <cfset thisTermLink = Replace(thisTerm,"*",";","ALL")>
>
>             <span class="rdLinkItem"><a
> href="#request.site.myself##XFA.search#&latSearchType=i&term=#request.objSea
> rchEngine.RemoveHighlights(thisTermlink)#">#thisTerm#</a></span>
>
>
> </cfloop>
>
> The output of "thisTerm" is
> "Blah yadda whatever"
> Each term is linked
>
> Is there a way to retain the semi colon. If I include it in the link, I wind
> up with a trailing semi-colon.

can you use a space as the delimiter?  that would retain the
semi-colon as part of each of the list elements.  should work as long
as you know there will always be a space between each item.

otherwise, you could manually add the semicolon, but either
programatically remove it after the loop finishes (using a combination
of left() and right() and len() functions) or using a conditional to
add the semi-colon manually UNLESS the current loop iteration is equal
to the length of the list.

but using a space as the delimiter would (IMO) be much better if the
format is consistent and the space will always be there (e.g. you
don't have something like "Blah; yadda;whatever")

-- 
Charlie Griefer

================================================
"...All the world shall be your enemy, Prince with a Thousand Enemies,
and whenever they catch you, they will kill you. But first they must catch
you, digger, listener, runner, prince with a swift warning.
Be cunning and full of tricks and your people shall never be destroyed."

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Macromedia ColdFusion MX7
Upgrade to MX7 & experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion?sdid=RVJW

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