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

Re: Property and variable


  • Subject: Re: Property and variable
  • From: Emmanuel <email@hidden>
  • Date: Fri, 3 Nov 2006 11:40:52 -0500

At 5:08 PM +0100 11/3/06, Jan Bultereys wrote:
Well if I use:
Set "variable1" to "variable2"

It won't be "available" in the handlers.

That's why I use property, unless there is an other way to make a variable "available" in a handler?

1/ If you use Smile there are plenty ways to make things global. Our preferred is to embed variables in a script, like we do with Graphic Library, check:
/Applications/Smile/Smile.app/Contents/Resources/Class Scripts/Context additions/Graphic Library


2/ Smile user or not, you can use the "global" declaration to have all handlers share a variable:

-- tested

on handler1()
	global myvar
	set myvar to "hello world"
end

on handler2()
	global myvar
	display dialog myvar
end

handler1()
handler2()

-- will display "hello world"

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

This email sent to email@hidden
References: 
 >Re: Property and variable (From: Jan Bultereys <email@hidden>)

  • Prev by Date: Re: Property and variable
  • Next by Date: Re: Little Help...
  • Previous by thread: Re: Property and variable
  • Next by thread: Re: Property and variable
  • Index(es):
    • Date
    • Thread