bug or feature?
bug or feature?
- Subject: bug or feature?
- From: "Donald S. Hall" <email@hidden>
- Date: Wed, 17 Oct 2001 21:07:46 -0600
hi all,
I was under the impression that global variables were not persistent from
run to run, only properties were. I was surprised to discover that global
variables seem in fact to also be persistent. You can see this by running
the following as an applet (Classic or OS X).
-------------------------------------------------------------------------
global x
try
class of x
display dialog (("Class of x is " & class of x as string) & return & ,
"Value of x is: " & x as string) & return & "No error"
on error
set x to "This is a test."
display dialog (("Class of x is " & class of x as string) & return & ,
"Value of x is: " & x as string) & return & "In error block"
end try
-------------------------------------------------------------------------
First run result:
display dialog "Class of x is string
Value of x is: This is a test.
In error block"
Second run result:
display dialog "Class of x is string
Value of x is: This is a test.
No error"
I get the same result with OS 9.2.1 (AS 1.6) or OS 10.1 (AS 1.7). The value
of x is remembered between runs. I wanted to use the fact that 'x' was
undefined to determine if my applet was already running when its open
handler was invoked by drag and drop.
Any comments?
Don
--
Donald S. Hall, Ph.D.
Apps & More Software Design, Inc.
http://www.theboss.net/appsmore
email@hidden