Re: recursion depth
Re: recursion depth
- Subject: Re: recursion depth
- From: Barry Wainwright <email@hidden>
- Date: Tue, 11 Oct 2005 22:12:44 +0100
- Thread-topic: recursion depth
On 11/10/05 19:18, "has" <email@hidden> wrote:
> Matt Neuburg wrote:
>
>> Examples as in my book, where recursion is used as a cute way of traversing
>> a list, are somewhat artificial and impractical,
>
> Indeed. Imperative languages simply aren't designed for that kind of use.
> Perhaps you could think about replacing with a more useful example that fits
> AppleScript's natural idioms?
>
> has
Here's a practical demonstration of recursion:
on commafy(theNum)
if theNum > 999 then return (commafy(theNum div 1000) & "," & text -3 ¬
thru -1 of ("00" & ((theNum mod 1000) as text)))
return theNum as text
end commafy
--
Barry
_______________________________________________
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