At 1:31 PM +0100 4/2/01, Francisca Sepúlveda wrote:
>Now: the documentation SAYS that FindStrInStr is void return - actually,
>looking in UI/Find.h I see that it returns Boolean, and the documentation
>would suggest that it returns TRUE if the string is found.
I think your documentation is out of date; the current API reference describes the
function correctly.
>Also, in all the
>examples, FindStrInStr returns Boolean. So ok, I assume that small part of
>documentation is wrong. However, the above example returns false. Which is
>puzzling. What am I doing wrong? Has anyone else had problems with this?
You have to prepare the search string first via GetCharCaselessValue() e.g.:
Char* origStr = "hello";
Char strToFind[32];
UInt8* convTab = GetCharCaselessValue();
UInt pos = 0;
Boolean match;
UInt16 i;
for (i = 0; origStr[i] != 0; i++)
strToFind[i] = convTab[origStr[i]];
strToFind[i] = 0;
match = FindStrInStr("hello", strToFind, &pos);
Regards,
Jim Schram
Palm Incorporated
Partner Engineering
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/