• 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
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Globals are considered harmful


  • Subject: Re: Globals are considered harmful
  • From: Doug McNutt <email@hidden>
  • Date: Sat, 7 Apr 2001 18:46:46 -0600

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

There is an interesting problem with calling AppleScripts from within a MacPerl script operating as an MPW tool. MPW crashes badly whenever an AppleScript is called while executing a perl script a second time without quitting and restarting MPW. It has been explained that the failure is caused by AppleScript caching features from the first call and expecting them to be in application memory on subsequent calls. Of course they aren't because MPW cleans up after its tools. Somehow AppleScript remembers things until an exit-to-shell system call is executed.

Are you quite sure that AppleScript isn't capable of caching globals? If not just what is it caching that causes the crashing? Does one get the same system code when asking MacPerl or MPW to execute an AppleScript in the form of text as he does when using the script editor or executing a compiled script from the finder?

--

-> From the U S of A, the only socialist country that refuses to admit it. <-


References: 
 >Re: Globals are considered harmful (was Re: Recursion script which doesn't?) (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Re: Hex2Int handler
  • Next by Date: Re: Month as Integer, redux
  • Previous by thread: Re: Globals are considered harmful (was Re: Recursion script which doesn't?)
  • Next by thread: Re: Globals are considered harmful (was Re: Recursion script which doesn't?)
  • Index(es):
    • Date
    • Thread