Re: Date anomaly
Re: Date anomaly
- Subject: Re: Date anomaly
- From: Deivy Petrescu <email@hidden>
- Date: Wed, 12 Mar 2003 22:32:24 -0500
On Monday, Mar 3, 2003, at 21:07 US/Eastern, Christopher Nebel wrote:
On Sunday, March 2, 2003, at 03:17 AM, John Delacour wrote:
At 10:33 am +0000 2/3/03, John Delacour wrote:
Can anyone explain why I'm getting this problem?
set d to "1/1/1"
date d
--> date "Monday, January 1, 2001 12:00:00 am"
(current date) - (date d)
--> Can't make date "Monday, January 1, 2001 12:00:00 am" into a
number or date.
Solved it, but this is new. It seems everything has to be GOT
nowadays :-<
As far as I can tell, this has never worked. I tried 1.1.2, 1.3.7,
1.8.3, and 1.9.1. It's a bug, or at least I'd consider it one --
something about not automatically evaluating object specifiers.
("date d" isn't a date, it's an object specifier that refers to a
date.) As you discovered, an explicit "get" will clear this up.
--Chris Nebel
AppleScript Engineering
_______________________________________________
Chris, you said that "date d" isn't a date.
But, check this out:
<script>
set d to "1/1/1"
log class of date d --------> date
log date d -------------------> (*Monday, January 1, 2001 0:00:00*)
set k to date d
log class of k ----------------> date
try
(current date) - (date d)
on error e
e -----------------------> "Can't make date \"Monday, January 1, 2001
0:00:00\" into a number or date."
end try
<script>
Exchanging k with date d works.
I've had other times when I had to coerce a class into itself to make
the script work.
Hard to understand why this would happen some times.
Thanks for any clarification.
_______________________________________________
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.