• 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: garbanzito <email@hidden>
  • Date: Thu, 17 May 2001 10:12:24 -0600

at 5/16/01, 3:49 PM -0600, they whom i call Ehsan Saffari wrote:

looks like a repeat loop is the only answer.

not necessarily:

-- counts non-list items in nested lists
on count_items(a_list)
local the_count
set the_count to 0
if class of a_list is not list then
set the_count to 1
else
if a_list is not {} then
set the_count to count_items(first item of a_list)
try -- fails if only 1 element
set the_count to the_count + (count_items(items 2 through -1 of a_list))
end try
end if -- not empty
end if -- is a list
return the_count
end count_items

steve harley email@hidden


  • Follow-Ups:
    • Re: Counting the items in anested list
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: usb modem support
  • Next by Date: Re: Time Delay with AppleScript
  • Previous by thread: Re: Counting the items in anested list
  • Next by thread: Re: Counting the items in anested list
  • Index(es):
    • Date
    • Thread