Thanks in advance!
Robert
x := Pos (AnsiUpperCase(String1), AnsiUpperCase(String2));
Hope this helps
Andreas
The easy approach is to download a copy of HyperString. It has 24 different
search routines written in assembler for maximum speed and efficiency.
http://www.mindspring.com/~efd/tools.htm
--
Ernie Deel, EFD Systems
-----------------------------------------------
Everything you can imagine is real.
take a look at mwipos.zip on the Super Page or Torry's.
Martin
>Robert Barr schrieb:
>
> Anyone have an idea how to do a Case Insensitive Pos() on a string?
>
> Thanks in advance!
>
> Robert
>Aw c'mon Ernie...the easist approach it to just upper-case both string
>arguments to th POS function. Certainly easier than downloading
>a bunch of components and messing around with all that.
Ok, perhaps I should have said "the most flexible and efficent approach is
...". Upper casing both arguments will work --- slowly.
With strings, the easy approach is often the slowest and may involve a
significant amount of unnecessary overhead. For example, assume you're
looking for a word in a 200K text using the "uppercase both arguments"
approach. The actual sequence of events is something like this:
- Allocate 200K of temporary string space
- Copy 200K to the temporary string
- Uppercase the 200K temporary string
- Do the search on the temporary string using Pos()
- De-allocate the temporary string and return the resultant.
If the word happens to be located within the first sentence, this is mostly
just wasted effort. And often the next question is "How do I continue
searching for the next occurance?" to which the reply is some equally nasty
and inefficient machinations involving string splitting and a repeat of the
steps above.
An efficient, flexible, general purpose string search routine can address
all of these problems and is much easier in the long run in my opinion but
to each his own.
arguments to th POS function. Certainly easier than downloading
a bunch of components and messing around with all that.
Oz
"Ernie Deel" <e...@remove.this.mindspring.com> wrote:
>Robert Barr wrote in message <35A8E805...@unm.edu>...
>>Anyone have an idea how to do a Case Insensitive Pos() on a
>>string?
>The easy approach is to download a copy of HyperString. It has 24 different
>search routines written in assembler for maximum speed and efficiency.
>http://www.mindspring.com/~efd/tools.htm
>--