• 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: "J. Stewart" <email@hidden>
  • Date: Fri, 3 Nov 2006 17:06:32 -0500

On 11/3/06 at -0500 Mark J. Reed said this

>The fact that handlers can't see "global" variables is generally considered
>a good thing. :)

Sorry Mark,

This statement is inaccurate. If it were true this script would not work.

--> Cut <--
global a, b

set a to 3
set b to 4

display dialog my adder() as Unicode text

on adder()
	return a + b
end adder
--> Cut <--

It would be more accurate to say - variables in the top level ("on run") handler aren't visible to sub-handlers unless specifically declared as global in scope (see above script) even though they share some of the other aspects of "global" variables.

JBS
--
Get a new car for your spouse.  It'll be a great trade!
 _______________________________________________
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: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: Battery or AC?
  • Next by Date: Re: Property and variable
  • Previous by thread: Re: Property and variable
  • Next by thread: Re: Property and variable
  • Index(es):
    • Date
    • Thread