• 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: Counting the items in anested list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Counting the items in anested list


  • Subject: Re: Counting the items in anested list
  • From: Nigel Garvey <email@hidden>
  • Date: Fri, 18 May 2001 12:21:24 +0100

Ehsan Saffari wrote on Wed, 16 May 2001 15:49:23 -0600:

>Thanks paul, that's it. A filter that only lets lists whose items are not
>lists through. so one could get the three items:
>
>{"a", "b"}
>{"c", "d"}
>{"e", "f"}
>
>looks like a repeat loop is the only answer.

And recursion, as in Paul's script.

For what it's worth, my take on that would be:

on listlessLists(aList)
set x to lists of aList
if x is {} then
1 -- add this listless list to the count
else
0 -- initialise the count
repeat with thisList in x
result + listlessLists(thisList)
end repeat
end if
-- return the result
end listlessLists

NG


  • Prev by Date: 4d, AS and MSword VBA problem
  • Next by Date: Re: Time for making PDFs
  • Previous by thread: Re: Counting the items in anested list
  • Next by thread: Searchable archives...
  • Index(es):
    • Date
    • Thread