You could also try the ASCII Value of a space instead, which is #Chr(32)#
~Simon
-----Original Message-----
From: Philip Arnold - ASP [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 31, 2000 1:18 PM
To: CF-Talk
Subject: RE: HELP w/CFLOOP DELIMITERS ?
> Im having a tiny problem with delimiters in a CFLOOP statement.
>
> The problem is directly out of Ben Forta's book in CF, Third Edition,
> Page 519, of "The ColdFusion Application Construction Kit".
>
> The LINE I'm having a problem with is the follow at the top of
> 519 in the code snippet.
>
> <!--LOOP through the words-->
> <CFLOOP INDEX="word" LIST="#search_for#" DELIMITERS=" ">
> <!-- Add the AND clause -->
> AND Title LIKE '%#word#%'
> </CFLOOP>
>
> My code is somewhat similar to this loop where only the variable
> names of changed....like so:
>
> <!--LOOP through the words-->
> <CFLOOP INDEX="word" LIST="#search_string#" DELIMITERS=" ">
> <!-- Add the AND clause -->
> AND ft_subject LIKE '#word#%'
> </CFLOOP>
>
> The problem child is the DELIMITER equaling a " ".
>
> If I leave the line as is...and then run the code, entering two words like
> "web agent" I get an error on the word AGENT, with CF telling me
> that its trying to process the word AGENT as a column name,
> which tells me that the CFLOOP DELIMITER of a space ISN'T
> working. Further proof of this is that when I run the same code
> but change the delimiter to equal a "+", and then re-enter the same
> search "web+agent"...it works just fine! This proves that the
> delimiter of a space DOESN'T work. OR that I can't follow
> simple instructions and that I couldn't code my way out of a
> wet paper bag.
>
> Any suggestions, aside from getting a dry paper bag ?
Here's one idea, try;
<!--LOOP through the words-->
<CFLOOP INDEX="word" LIST="#Replace(search_string,' ',',','all')#">
<!-- Add the AND clause -->
AND ft_subject LIKE '#word#%'
</CFLOOP>
This will replace the spaces with commas, and I know looping through lists
with commas is much more friendly in CF
Philip Arnold
ASP Multimedia Limited
T: +44 (0)20 8680 1133
"Websites for the real world"
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************
----------------------------------------------------------------------------
--------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a
message with 'unsubscribe' in the body to [EMAIL PROTECTED]
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message
with 'unsubscribe' in the body to [EMAIL PROTECTED]