• 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: Globals are considered harmful (was Re: Recursion script which doesn't?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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. |
----------------------------------------------------------------------


  • Prev by Date: Re: Archive on Goggle
  • Next by Date: Re: Globals are considered harmful (was Re: Recursion script which doesn't?)
  • Previous by thread: Re: Hex2Int handler
  • Next by thread: Re: Globals are considered harmful (was Re: Recursion script which doesn't?)
  • Index(es):
    • Date
    • Thread