Re: Handlers in a variable
Re: Handlers in a variable
- Subject: Re: Handlers in a variable
- From: Nigel Garvey <email@hidden>
- Date: Sat, 16 Jan 2016 12:42:21 +0000
"Mark J. Reed" wrote on Fri, 15 Jan 2016 22:19:42 -0500:
> to call(aHandler, aValue)
> aHandler(aValue)
> end
>
> call(double, 4)
>
> error "«script» doesn’t understand the “aHandler” message." number
>-1708 from «script»
Hi Mark.
The handler has to be transferred to a non-local variable and called
with that. eg.:
to call(aHandler, aValue)
global h
set h to aHandler
h(aValue)
end call
Or avoiding a global:
to call(aHandler, aValue)
script o
property h : aHandler
end script
o's h(aValue)
end call
NG
_______________________________________________
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