At 11:15 AM +0800 12/14/00, John Erazo wrote:
>Hi everyone.
>
>I think have I found a better approach to what was
>I was trying to achieve - a case-insensitive search
>through a linear list of text strings. getOne() and
>getPos() will not work in my situation.
>
John,
I'm sorry I haven't followed this too closely, but I do have a
different approach. If you use symbols instead of strings, then you
can use "getOne" for your lookup. It will be very fast and
case-insensitive. From the message window:
-- Welcome to Director --
gList = [#sun, #mercury, #venus, #earth, #mars]
put getOne(gList, #SuN)
-- 1
put getOne(gList, #VENUS)
-- 3
put getOne(gList, #venus)
-- 3
put getOne(gList, #notFoundInList)
-- 0
put getOne(gList, symbol("EARTH"))
-- 4
Notice in the last one, that you can turn a string into a symbol easily.
Enjoy,
Irv
--
Lingo / Director / Shockwave development for all occasions.
(Over two millions lines of Lingo code served!)
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]