• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Getting elements of a list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting elements of a list


  • Subject: Re: Getting elements of a list
  • From: Skeeve <email@hidden>
  • Date: Sat, 19 Apr 2008 17:25:12 +0200

Mark J. Reed wrote:
Say I have a list of lists:

set myList to {{1,2},{3,4},{5,6}}

get_every(1, {{1, 2}, {3, 4}, {5, 6}})

to get_every(nth_item, of_list)
if of_list is {} then return {}
return {item nth_item of first item of of_list} & get_every(nth_item, rest of of_list)
end get_every


good old recursion...


_______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
References: 
 >Getting elements of a list (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: Getting elements of a list
  • Next by Date: ? regarding rebooting apps using an applescript
  • Previous by thread: Re: Getting elements of a list
  • Next by thread: Re: Getting elements of a list
  • Index(es):
    • Date
    • Thread