Re: Globals are considered harmful (was Re: Recursion script which doesn't?)
Re: Globals are considered harmful (was Re: Recursion script which doesn't?)
- Subject: Re: Globals are considered harmful (was Re: Recursion script which doesn't?)
- From: Michelle Steiner <email@hidden>
- Date: Sun, 8 Apr 2001 06:44:05 -0700
On 4/7/01 10:35 AM, Paul Berkowitz <email@hidden> wrote:
>
The thing is: although theoretically persistent, globals have to be set to
>
be used, otherwise they error as undefined variables. So the next time you
>
run the script, they are automatically reset to the original setting, and
>
are thus effectively not persistent. You can't even start out
>
>
if someGlobal "" then --if someGlobal is not "" then
>
--do something
>
else
>
set someGlobal to something
>
end if
>
>
like you do with a property, because that will error as undefined as well.
but you can do something like
try
someGlobal
on error
set someGlobal to something
end try
--do somthing involving someGlobal
--Michelle
----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spiritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------