sigh.  you're right.  i didn't look closely enough, and got misled by line
81.
the reason it works perfectly for me is because yes i am using it in
response to the Find command.

if you use it in some other scenario, then you're right, you must pass a
caseless string to it.
sorry folks, my bad.  (OOPS!)

summary:
*  if you use FindStrInStr in response to the system Find command, you don't
need to do anything special, just pass it the FindParams.strToFind and
whatever you string you want to search for it in.
*  if you use FindStrInStr in some other situation, then the strToFind
parameter must have been converted via the GetCaselessSortValue table (see
CharAttr.h).



----- Original Message -----
From: Bozidar Benc <[EMAIL PROTECTED]>
To: Chris Antos <[EMAIL PROTECTED]>
Sent: Sunday, September 05, 1999 1:11 AM
Subject: RE: FindStrInStr returns always FALSE?


> Chris,
>
> What I was talking about is strToFind parameter of the FindStrInStr
> function.
> My mistake was probably because I named it "string to search for" (as you
> can
> see my English is not too good).
>
> I looked at the source code. In the comment they say:
>
>  *              This routine assumes that the string to find is in
>  *              lower case characters.
>
> That's the reason why I had to use that "conversion" code in my own
> Find/FindNext routine.
>
> Take a closer look into the function. It does convert the first parameter,
> but it
> doesn't convert the second parameter:
>
> s1 = (BytePtr) strToFind;
> s2 = (BytePtr) &strToSearch[pos];
>
> do {
> c1 = *s1++;
> c2 = *s2++;
> result = c1 - tableP[c2];
> } while (result == 0 && c1 != '\0');
>
>
> Regards
>
> Bozidar
>
>
> > ack.  please look at the source code and i think you will see that
> > FindStrInStr automatically does the conversion you claim must be done
> > manually.
> >
> >
> > ----- Original Message -----
> > From: Bozidar Benc <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Saturday, September 04, 1999 2:44 PM
> > Subject: RE: FindStrInStr returns always FALSE?
> >
> >
> > > It certainly is not, as you say, a placebo.
> > >
> > > You don't have to use such a "conversion" in your Search procedure
> > > which acts as a support for the system "Find" because you've already
> > > got the converted string (pointer) in the parameter block.
> > >
> > > However, if you want to use FindStrInStr for some other purpose (like
I
> > > did),
> > > you must prepare (convert) the string to search for.
> > >
> > >
> > > Regards
> > >
> > > Bozidar
> > >
> > >
> > >
> > > > i don't know how GetCaselessSortValue is implemented on non-Latin
> > > > versions,
> > > > so i can't speak to that.  but from looking at the source, Bozidar's
> > > > suggestion is purely placebo and does not affect the execution AT
ALL,
> > at
> > > > least not on OS3.  from looking at the source, i seriously doubt
that
> > Palm
> > > > is going to screw it up for non-Latin as you imply.
> > >
> > >
> >
> >
>

Reply via email to