Re: How to simulate C's function pointer in AppleScript?
Re: How to simulate C's function pointer in AppleScript?
- Subject: Re: How to simulate C's function pointer in AppleScript?
- From: "Mark J. Reed" <email@hidden>
- Date: Thu, 23 Oct 2008 10:19:10 -0400
What I was thinking of was this:
script scriptToTime
on run()
display dialog "beep"
end run
end script
script Timer
on timeit(procedure)
run script procedure
end timeit
end script
Timer's timeit(scriptToTime)
If you want to initialize the procedure once and then time it many
times, you can do this:
script Timer
property procedure: missing value
on setProcedure(newProcedure)
set my procedure to newProcedure
end setProcedure
on timeit()
run script procedure
end timeit
end script
Or if you're not concerned about encapsulation you can just
set Timer's procedure to whatever
before calling timeit.
--
Mark J. Reed <email@hidden>
_______________________________________________
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