• 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: Creating list references in handlers. Bad code or bug?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating list references in handlers. Bad code or bug?


  • Subject: Re: Creating list references in handlers. Bad code or bug?
  • From: Jon Pugh <email@hidden>
  • Date: Sun, 16 Sep 2001 15:19:48 -0700

At 4:19 PM -0400 9/16/2001, Victor Yee wrote:
>Hmmm, is this a bug?
>
>set x to {1, 2}
>set end of x's contents to 3
>x
>--> {1, 2}

No, "end" is not the last item, it's the position after the last item, and it's used for appending items onto a list.

For example:

set x to {1, 2}
set end of x to 3
x
--> {1, 2, 3}

If you want to change the last item, do this:

set x to {1, 2}
set last item of x to 3
x
--> {1, 3}

I don't see a bug, except perhaps that end of x's contents (which is equivalent to contents of end of x) doesn't error.

Jon


  • Follow-Ups:
    • Re: Creating list references in handlers. Bad code or bug?
      • From: Deivy Petrescu <email@hidden>
References: 
 >Re: Creating list references in handlers. Bad code or bug? (From: Victor Yee <email@hidden>)

  • Prev by Date: Re: Existing Entourage Message
  • Next by Date: Re: How to wait for a PostScript file to finish it's creation?
  • Previous by thread: Re: Creating list references in handlers. Bad code or bug?
  • Next by thread: Re: Creating list references in handlers. Bad code or bug?
  • Index(es):
    • Date
    • Thread