Date Variables that modify themselves! Huh?
Date Variables that modify themselves! Huh?
- Subject: Date Variables that modify themselves! Huh?
- From: Guy Parker <email@hidden>
- Date: Wed, 04 Jul 2001 14:17:09 +0100
This seems like weird behaviour to me but maybe I'm being dumb! Any ideas?
In the example as written below the action of modifying one variable
(DateTimeSend) affects another variable (DateTimeNow) from which the first
was derived. If the line containing "--this fails" is replaced by the one
containing "--this works" then the action of modifying one variable does not
affect the other.
How is it that modifying one variable affects another from which it was
originally derived? Maybe it is a date related issue but it seems strange to
me!
I would prefer to use just one instance of "current date" since there is a
(small) risk that more than just the time could be different if it is used
twice.
Thanks,
Guy
tell application "Finder"
set DateTimeNow to (current date)
set DateTimeSend to DateTimeNow --this fails
--set DateTimeSend to (current date) --this works
set DelayTime to 10800 --set time to 3am
display dialog "These should both be identical:
" & (DateTimeNow as text) & "
" & (DateTimeSend as text)
set time of DateTimeSend to DelayTime
display dialog "These should both be different:
" & (DateTimeNow as text) & "
" & (DateTimeSend as text)
end tell