Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: *Very* strange script / global variable behavior



Yet another, still simpler, variation on this puzzle:

	property theState : 0
	
	script Inner
		on showTheState()
			display dialog "State " & theState
		end showTheState
	end script
	
	script Outer
		Inner
	end script
	
	set x to Outer
	
	set theState to 1
	tell Inner to showTheState()
	set theState to 2
	tell Inner to showTheState()

As before, running this program will display "State 0" twice. Either changing the "property" declaration to a "global" declaration, or commenting out the "set x to Outer" statement, will cause it to display "State 1", "State 2".

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden
References: 
 >*Very* strange script / global variable behavior (From: Neil Faiman <email@hidden>)
 >Re: *Very* strange script / global variable behavior (From: Neil Faiman <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.