Re: lists and items and position of items
Re: lists and items and position of items
- Subject: Re: lists and items and position of items
- From: Bill Briggs <email@hidden>
- Date: Sat, 12 Mar 2005 09:42:23 -0400
At 9:50 AM +0100 3/11/05, Christian Vinaa wrote:
based on Apples example:
on list_position(this_item, this_list)
repeat with i from 1 to the count of this_list
if item i of this_list is this_item then return i
end repeat
return 0
end list_position
set xList to {}
set this_list to {"Sal", "Sue", "Bob", "Carl"}
repeat with x in this_list
set y to list_position(x, this_list)
copy y to end of xList
end repeat
get xList
You've already heard the correct explanation, but to fix the code
you can just add two words.
Change
set y to list_position(x, this_list)
to
set y to list_position(x as item, this_list)
and you'll get your expected result.
- web
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden