Re: Best practices- nested loops or handlers or both
Re: Best practices- nested loops or handlers or both
- Subject: Re: Best practices- nested loops or handlers or both
- From: Eric Geoffroy <email@hidden>
- Date: Wed, 03 Nov 2004 13:06:43 -0800
Neil,
In your revised, improved simple loop, it returns d on the fifth line.
In my list of dates, the handler hits this line and stops processing
that value after pushing it to Monday. It keeps evaluating the rest of
the items I think. So far so good. (It's getting clearer)
Now I'm populating a new list with the results of the getNextBizDay(d)
handler. It goes like this:
set lisa to {}
repeat with x in Dz -- skips any blanks in the Dz list
if contents of x is not "" then
set x to date x
set end of lisa to my getNextBizDay(x)
else
set end of lisa to "" -- Keeps the items in order (important)
end if
end repeat
Setting the end of my list named "Lisa" to the getNextBizDay handler
fills it with the original unmodified dates. This is baffling to me.
Thanks for the help.
- Eric
On Nov 1, 2004, at 4:25 PM, Neil Faiman wrote:
But recursion is overkill in this example. A simple loop works just as
well:
on getNextBusinessDay(d)
repeat while isWeekend(d) or isHoliday(d)
d = d + 1
end repeat
return d
end getNextBusinessDay
Regards,
Neil Faiman
_______________________________________________
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