FindStrInStr
Purpose: Perform a case-blind partial word search for a string in another
string. This function assumes that the string to find is in lower-case
characters.
Prototype: Boolean FindStrInStr (const CharPtr strToSearch,
const CharPtr strToFind, const WordPtr posP)
Parameters:
strToSearch = String to search.
strToFind = Converted, caseless version of the ASCII text string to be
found.
posP = Pointer to offset in search string of the match.
Result: Returns true if the string was found. FindStrInStr matches the
beginnings of words only; that is, strToFind must be a prefix of
one of the words in strToSearch for FindStrInStr to return
true.
Comment: Don't use this function on systems that support the Text Manager.
Instead, use TxtFindString, which performs searches on strings
that contain multi-byte characters and returns the length of the
matching text.
On systems that don't support the Text Manager, use Use
GetCharCaselessValue to convert a string into the appropriate
format for strToFind in code similar to the following:
CharPtr origStr;
/* Standard null-terminated ascii string */
CharPtr strToFind;
/* Converted string to be passed to */
/* FindStrInStr */
BytePtr convTab;
/* Conversion table returned from */
/* GetCharCaselessValue*/
Word i;
convTab = GetCharCaselessValue();
for (i=0; origStr[i] != 0; i++)
{
strToFind[i] = convTab[origStr[i]];
}
strToFind[i] = 0;
/* Now pass strToFind to FindStrInStr...*/
Note that the strToFind element of the parameter block passed by
the system's Find utility is preconverted, so it can be passed straight
through to FindStrInStr.
------------------------------------------------------------------
Jason Henderson
Software Engineer
EagleSoft, A Patterson Co.
"The significant problems we face cannot be solved by the same
level of thinking that created them." - Albert Einstein
-----Original Message-----
From: Rhoda BEROL [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 12, 2001 11:11 AM
To: Palm Developer Forum
Subject: Re: search function
I try to use the function FindStrInStr, but I don't find the right function
that convert a text into the right format for this function.
----- Original Message -----
From: "Jason Henderson" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Thursday, July 12, 2001 5:50 PM
Subject: RE: search function
> Of course its possible.
>
> Look up info on the Global Find Facility.
>
> ------------------------------------------------------------------
> Jason Henderson
> Software Engineer
> EagleSoft, A Patterson Co.
>
> "The significant problems we face cannot be solved by the same
> level of thinking that created them." - Albert Einstein
>
>
> -----Original Message-----
> From: Rhoda BEROL [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 12, 2001 10:46 AM
> To: Palm Developer Forum
> Subject: search function
>
>
> I want to create a search function. The user will be able to search record
> with criterion.
> An example: search people who live in Paris.
>
> Is it possible ?
> And how can I do it?
>
> Thanks
> Rhoda
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
> please see http://www.palmos.com/dev/tech/support/forums/
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
>
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/