Re: getting the rank of an element of a list
Re: getting the rank of an element of a list
- Subject: Re: getting the rank of an element of a list
- From: Gary Lists <email@hidden>
- Date: Sun, 27 Jul 2003 06:58:44 -0400
>
On 7/27/03 1:38 AM, "Reinforced Darkness" <email@hidden> wrote:
>
>
> Hi,
>
> it's a newbie question but consider
>
> //
>
> set la_liste to {"a","b","c","d"}
>
> get ???? of "b" in la_liste
>
> //
>
>
>
> I've tried index, rank... doesn't work
>
>
>
> RD
On or about 7/27/03 4:55 AM, Andrew Oliver wrote:
>
Standard AppleScript doesn't offer any way of doing this directly (which
>
would explain why you're having trouble). You have to walk the list to find
>
the match.
-- no OSAX method (maybe not the fastest for a very long list
set la_liste to {"a", "b", "c", "d"}
set la_lettre to "b"
repeat with dou from 1 to length of la_liste
if item dou of la_liste is la_lettre then return dou
end repeat
--> 2
HTH
--
Gary
MacOS 9.1 / "9 is Fine"
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.