Find a text in a list

Sarah Reichelt sarahr at genesearch.com.au
Tue Dec 16 17:15:33 EST 2003


Do you really need the line numbers? If you just need the actual names, 
then the filter command will be the easiest to use:

put fld "List" into tList
filter tList with "*klau *"
-- space AFTER name to make sure it filters by last name (1st on line)
filter tList with "* maj*"
-- space BEFORE name to make sure it filters by first name (2nd on line)

tList now contains
  Major Klaus
  Major Klaudia

If you need to know the line numbers, you could now use lineOffset to 
find the filtered entries in the original list.

e.g.
repeat for each line L in tList
   put lineOffset(L, fld "List") & cr after numberList
end repeat

Cheers,
Sarah
sarahr at genesearch.com.au
http://www.troz.net/Rev/

On 16 Dec 2003, at 10:47 pm, Yves COPPE wrote:

> Hi,
>
>
> I have a list of names.
>
> Id like to type the first letters of the name and the first letters of 
> the first name to retrieve all the names beginning with those letters.
>
>
> for ex.
>
> a list with
>
> Gaskin Richard
> Major Klaus
> Major Klaudia
> Rice Alex
> Rossi Scott
> Schenkel Jan
>
>
> If I type in a "ask" dialog :
>
> "klau maj"
> or
> "maj klau"
>
>
> the result should be :
> 2
> 3
>
> respectively the numbers of the lines where those chunk are present
>
> I've tried wtih lineOffset but without success..
>
> Can anyone help me ?
> Thank you.
>
> Greetings.
>
> Yves COPPE
> yvescoppe at skynet.be
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
>



More information about the use-livecode mailing list