[thelist] Help with a replace loop
rudy limeback
r937 at interlog.com
Tue Jun 12 14:29:15 CDT 2001
> However, the first loop matches terms inside of terms,
> which messes things up a little.
okay, that's easy to fix, don't do the first loop! ;o)
instead of
><cfquery name="getTerms" datasource="theDataSource">
> select *
> from Glossary
></cfquery>
>
><cfloop query="getTerms">
> <cfset varcopy = ReplaceNoCase(varcopy,'#term#','~#term#~',"ALL")>
></cfloop>
just do this
<cfquery name="getWonkyTerms" datasource="theDataSource">
select '~' || term as wonkyterm
from Glossary
</cfquery>
that way each wonkyterm will have the wonky character at the front, and you
don't have to do a replace on them
rudy
More information about the thelist
mailing list