Re: Date math question
Re: Date math question
- Subject: Re: Date math question
- From: Paul Berkowitz <email@hidden>
- Date: Mon, 09 Jun 2003 11:34:32 -0700
On 6/9/03 11:14 AM, "Michelle Steiner" <email@hidden> wrote:
>
>
On Monday, June 9, 2003, at 10:46 AM, Paul Berkowitz wrote:
>
>
> It has to be resolved first:
>
>
>
> (date foo) - (get date bar)
>
>
So why does one have to have the get, but not the other one?
Because the second has a second operand, namely the subtraction operation,
needing to work on it. AFAICS, a call to 'date' is needed to "convert" the
'date' command plus an appropriate string to the date data type, before you
can do anything with it. In the first case (date foo), that's fine, that's
what it does. In the second case (date bar, without the explicit get) ,
you're trying to subtract something that isn't yet a date data type, so it
errors. As usual the error message isn't overly helpful. In the third case
(get date bar with explicit get) you force the conversion to date data type
within the parentheses first, before the " - " operator goes to work, so all
is OK.
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.