Re: what is the best way to 'unset' a variable
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.