Re: varibles in handler
Re: varibles in handler
- Subject: Re: varibles in handler
- From: Robert Poland <email@hidden>
- Date: Mon, 17 Jan 2011 16:37:22 -0700
> On Jan 17, 2011, at 4:21 PM, Stockly, Ed wrote:
>
>
>
>> In the line "my setDelimiters(originalDelimiters)" originalDelimiters is a
> variable. It seems to be totally ignored by the handler.
>
> When you pass a variable to a handler the handler creates a local variable
> with the whatever label you include in the handler declaration. It does not
> use the variable name you include in your handler call.
> -------
> On run
> Set callVariable to "1"
> My foo ( callVariable )
> End run
>
> On foo (handlerVariable)
> Display dialog handlerVariable
> Display dialog callVariable -- will error out since it is not declared in
> the handler
> End
> ---------
>
> This is also true if you send a property to a handler.
> ----------
> Property callProperty: 1
> My foo ( callProperty )
> End run
>
> On foo (handlerVariable)
> Display dialog handlerVariable
> Display dialog callProperty -- will not error out since it is a property
> End
> ---------
Ed,
If you set callVariable as a global, as I did, it runs fine.
Robert Poland - Fort Collins, CO
_______________________________________________
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/archives/applescript-users
This email sent to email@hidden