• 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: what is the best way to 'unset' a variable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: what is the best way to 'unset' a variable


  • Subject: Re: what is the best way to 'unset' a variable
  • From: Steven Angier <email@hidden>
  • Date: Sun, 24 Mar 2002 09:58:55 +1100
  • Organization: Macscript.com

has wrote:

> Steven Angier wrote:
>
> >You can destroy a variable in AppleScript by setting its value to nothing,
> >though I'm not
> >sure why you'd want to:
> >
> >set x to 1
> >set x to GetNothing()
> >return x
> >
> >on GetNothing()
> >return
> >end
>
> Uh-uh. That just gives an error on the second line: "No result was returned
> from some part of this expression."

It works on all machines I have available for testing (AS 1.6 through 1.8.x; OS 9.x and OS
10.1.x)


> Anyway, you can't "destroy a variable"

I just did.
I have accidently destroyed lots of objects in my scripts using this method (setting a
variable to the result of a function which returns nothing). Whether or not this is of any
practical use is another matter.


Steven Angier
Macscript.com
_______________________________________________
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.

References: 
 >Re: what is the best way to 'unset' a variable (From: has <email@hidden>)

  • Prev by Date: Re: Finding folder from its id
  • Next by Date: Re: Finding folder from its id
  • Previous by thread: Re: what is the best way to 'unset' a variable
  • Next by thread: Re: what is the best way to 'unset' a variable
  • Index(es):
    • Date
    • Thread