• 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: copy & set statments
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: copy & set statments


  • Subject: Re: copy & set statments
  • From: Nigel Garvey <email@hidden>
  • Date: Mon, 22 Oct 2001 14:17:47 +0100

Nigel Garvey wrote on Sun, 21 Oct 2001 15:54:21 +0100:

>This is something to remember when passing a list or a record as a
>parameter to a handler. The local variable inside the handler is a local
>copy of the pointer to the original structure, not a local copy of the
>structure itself. If you want to fool around with the structure's innards
>and still have the original intact when the handler returns, use the
>'copy' comand first:
>
> on myHandler(myList)
>
> -- Reassign the variable to a local copy of the list
> copy myList to myList
>
> -- etc.
>
> end myHandler

I've been thinking about "local copy of the list" since posting this. It
is of course possible to pass a "local" list out of a handler as a return
value, which can be used outside the handler. Presumably, what's returned
is just a copy of the pointer, so the list itself can't actually be
considered to be "local". The description only applies to the variable
used inside the handler.

NG


  • Follow-Ups:
    • Re: copy & set statements
      • From: Timothy Bates <email@hidden>
  • Prev by Date: ANNOUNCE: Image Info 0.8 Beta
  • Next by Date: Re: Shortcut Keys?
  • Previous by thread: RE: copy & set statments
  • Next by thread: Re: copy & set statements
  • Index(es):
    • Date
    • Thread