• 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: list question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: list question


  • Subject: Re: list question
  • From: Jon Pugh <email@hidden>
  • Date: Wed, 4 Jun 2003 14:16:27 -0700

At 11:09 AM -0600 6/4/03, Doug McNutt wrote:
>set a to 2
>set b to a
>set c to a + b
>c
>--> 4
>set a to a + 1
>set c to a + b
>c
>--> 5
>
>Can you explain just how "b" here refers to the same object as "a". Why doesn't the second calculation return 6? (I'd really be upset if it did!)

set nums to {1, 2, 3, 4, 5}
set a to a reference to item 2 of nums
set b to a
set c to a + b
set contents of a to a + 1
set d to a + b
{a, b, c, d, nums}

Does this make any more sense?

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

  • Follow-Ups:
    • by-value vs by reference (was Re: list question)
      • From: Andrew <email@hidden>
References: 
 >Re: list question (From: Chris Page <email@hidden>)
 >Re: list question (From: Doug McNutt <email@hidden>)

  • Prev by Date: RE: Quark - search and replace
  • Next by Date: Mount Volumes
  • Previous by thread: Re: list question
  • Next by thread: by-value vs by reference (was Re: list question)
  • Index(es):
    • Date
    • Thread