Re: Date Variables that modify themselves! Huh?
Re: Date Variables that modify themselves! Huh?
- Subject: Re: Date Variables that modify themselves! Huh?
- From: Michelle Steiner <email@hidden>
- Date: Wed, 4 Jul 2001 07:29:02 -0700
On 7/4/01 6:17 AM, Guy Parker <email@hidden> wrote:
>
tell application "Finder"
>
set DateTimeNow to (current date)
>
set DateTimeSend to DateTimeNow --this fails
>
--set DateTimeSend to (current date) --this works
<snip>
>
set time of DateTimeSend to DelayTime
"time" is a record. When you set one record equal to another record,
they're the same record. So, when you change one of them, the other is
changed also, because they're the same thing.
If you copy a record, you make a copy, so there are two records.
In other words, whenever you have
set record1 to record2
they will always be identical; changes to one will be changes to both.
So, if you rewrite your second set to
copy DateTimeNow to DateTimeSend
you will not have this problem.
BTW, the same is also true for lists and script objects.
--Michelle
----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spiritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------