Kristine,
I had a follow up though. How is the variable or string that you are
searching through created? If the string is not created by ColdFusion, it
probably makes it a little easier. If you are generating the string, you
will have to make sure that you escape the string before you start searching
through it.
I am not sure if this helps, but an example is the following:
<cfset foo = "This is a sentence with C## in it." />
The variable "foo" becomes the sentence:
This is a sentence with C# in it.
To prove this:
<cfoutput>
#Find("C#chr(35)#", foo)#<br />
#Find("C#chr(35)##chr(35)#", foo)#<br />
</cfoutput>
Note: #chr(35)# gets the "#" symbol by calling it from the ASCII table.
Now the first line in the <cfoutput> evaluates to a number where the first
instance of "C#" occurs, which is 25.
The second line is looking for "C##," and this returns 0, which means an
instance of the sub-string was not found.
I know this example is really simple and I apologize if this over simplifies
the issue, but I wanted to bring awareness to problem from how your search
string is created and what you are trying to do with it afterward. Many
problems I have to deal with have a "source" that may not be in the same
location of the error or abhorrent behavior.
Follow the code from the source of data and stepping over the application to
watch for how your code manipulates the data could provide better
introspection to the overall problem.
HTH,
Teddy R. Payne, ACCFD
Google Talk - [email protected]
On Mon, Feb 8, 2010 at 12:56 PM, Teddy R. Payne <[email protected]>wrote:
> Kristine,
> Are you trying to search through a string variable for a string pattern of
> "C#"? Then after you find it, you are putting "C#" into a query call?
>
>
> Teddy R. Payne, ACCFD
> Google Talk - [email protected]
>
>
>
>
> On Mon, Feb 8, 2010 at 12:49 PM, Kristine <[email protected]> wrote:
>
>> I’m pretty desparate to try to search on a keyword called “C#”. I’m
>> using a coldfusion page that grabs a bunch of variables and puts them all
>> together in a series of statements that gets pushed straight into a CFQUERY
>> command when the #strkeywords# variable is put into the statement it
>> contains the keyword ‘C#’ because I’ve changed C# to C## which the page then
>> reads as C#. However, what used to work (I think we use CF 8.0) doesn’t
>> anymore and it’s completely ignoring the # part and sees only the ‘C’ which
>> it then kicks back as a noise word.
>>
>>
>>
>> Yuck.
>>
>>
>>
>> Can anyone help guide me out there?
>>
>>
>>
>> -------------------------------------------------------------
>> To unsubscribe from this list, manage your profile @
>> http://www.acfug.org?fa=login.edituserform
>>
>> For more info, see http://www.acfug.org/mailinglists
>> Archive @ http://www.mail-archive.com/discussion%40acfug.org/
>> List hosted by FusionLink <http://www.fusionlink.com>
>> -------------------------------------------------------------
>
>
>