• 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 schmobals (WAS Idle Help)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: globals schmobals (WAS Idle Help)


  • Subject: Re: globals schmobals (WAS Idle Help)
  • From: Richard 23 <email@hidden>
  • Date: Thu, 7 Dec 2000 17:33:21 -0800

>globals do not remember their settings from the last run,
>properties do (unless you recompile them, then they start
>fresh on the first run after the recompile)

balderdash! This would be fine if true but for me they
have only functioned as unreliable properties.

I thought they would be useful for detecting the first
call of an initialization handler which wouldn't be called
again until the next launch (by checking whether a global
is undefined and instead of starting as undefined each run,
the value persisted. When I tried to see if there was any
advantage using them as properties I had to eventually
get rid of them all because they would persist for a while
then flicker out seemingly without cause.

Maybe I'm crazy (pretty likely but unrelated)...

Here's an example I tossed together. Whether at the
top-level, handler-level, running as a script or as an
independent applet, the global values persisted just
like properties (but I won't trust them in that capacity
again)...


--------------------

TestMe()

on TestMe()
global exile
global ships_log

try
-- set theDefault to
get exile
on error
set ships_log to {}
end try

set exile to choose from list {"Europe", "Asia", "Canada", ==>
"Africa", "South America", "Galapogos", "Mars", ==>
"Antarctica", "Heart of the Sun"} default items result ==>
with prompt "where shall we exile the in-laws to today? (" ==>
& length of ships_log & ")"
set end of ships_log to result as item
ships_log
end TestMe


I don't know if any of you remember the discussion about as item
from earlier in the week. Here it is again doing absolutely nothing.
I find the coercion quite useful if I may be Frank (Booth) for a brief
moment. Back to the world of dreams....

R23


  • Prev by Date: (no subject)
  • Next by Date: Re: Idle Help
  • Previous by thread: (no subject)
  • Next by thread: Creator Code Changing
  • Index(es):
    • Date
    • Thread