• 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: How to simulate C's function pointer in AppleScript?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: How to simulate C's function pointer in AppleScript?
      • From: André Berg <email@hidden>
References: 
 >How to simulate C's function pointer in AppleScript? (From: André Berg <email@hidden>)
 >Re: How to simulate C's function pointer in AppleScript? (From: Philip Aker <email@hidden>)
 >Re: How to simulate C's function pointer in AppleScript? (From: André Berg <email@hidden>)
 >Re: How to simulate C's function pointer in AppleScript? (From: "Mark J. Reed" <email@hidden>)
 >Re: How to simulate C's function pointer in AppleScript? (From: André Berg <email@hidden>)

  • Prev by Date: Re: How to simulate C's function pointer in AppleScript?
  • Next by Date: Path to syntax request
  • Previous by thread: Re: How to simulate C's function pointer in AppleScript?
  • Next by thread: Re: How to simulate C's function pointer in AppleScript?
  • Index(es):
    • Date
    • Thread