Problem with INSTR()

John Esak john at valar.com
Wed Feb 15 07:22:04 PST 2006


> Quoting John Esak (Wed, 15 Feb 2006 08:46:51 -0500):
>
> >
> > Hi Ken,
> >
> > A guy came into the room today, and told me that INSTR() is returning
> > the position of little "l" in a string instead of capital "L" when he
> > uses chr("76") which is a capital "L". So, I tried the following and
> > found he was right.
> [...]
>
> You're forgetting that filePro is case-insensitive here.  Using INSTR()
> to find "L" will also find "l".
>

I'll bring this private email to the list.  Yes, I am certainly aware that
filePro is case-insensitive when doing compares on an "if" line with "eq" or
even "=". However, this is a function call to look for a specific
*character*... and little "l" is completely *not* big "L". :-)  I mean, it
seems like you would have had to go out of your way to make the INSTR() work
in this way. Why?   I remember when Jay brought up the fact that testing was
not case-sensitive and this bothered him greatly.  I remember  thinking and
maybe even posting that this has never bothered me in 20 years. It just
seemed and still seems fine for all the compares that I do... in processing
and more especially in index selection.  I *want* case-insensitivity,
however, I have to differ with you, possibly for the very first time, as to
desirability when a function is passed a specific chr() value and you return
the position for a totally different chr() value.  I don't think this really
can be justified as being reasonable.  What was/is your reason for doing it
this way?  Why would it ever be beneficial to circumvent the specific use of
a chr() value if used. I can see keeping filePro's default
case-insensitivity if regular characters are used... but, if the specific
use of a chr() value is there, I think it should be respected. In the same
way it works in so many other instances... to get specific and exact
references in other situations like backslashes, quotes, etc., one usually
turns to chr() values for many things in filePro. It disturbs me that this
can't be done here.

Of course, we run into the same old "it's been that way for decades... and
you just noticed it now..." syndrome. Agreed, I have never run into this
myself, so how important is it really?  Well, maybe not so very important,
but for consistency and conformity's sake, how about an environment variable
that would make it right if one it. And by right... I mean "my" way of
course! :-) :-) :-)

John




More information about the Filepro-list mailing list