• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Date Variables that modify themselves! Huh?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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. |
----------------------------------------------------------------------


  • Follow-Ups:
    • Re: Date Variables that modify themselves! Huh?
      • From: Paul Berkowitz <email@hidden>
    • Re: Date Variables that modify themselves! Huh?
      • From: Guy Parker <email@hidden>
  • Prev by Date: Re: Date Variables that modify themselves! Huh?
  • Next by Date: akua sa
  • Previous by thread: Re: Date Variables that modify themselves! Huh?
  • Next by thread: Re: Date Variables that modify themselves! Huh?
  • Index(es):
    • Date
    • Thread