• 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: Jay Louvion <email@hidden>
  • Date: Thu, 23 Oct 2008 13:03:15 +0200
  • Thread-topic: How to simulate C's function pointer in AppleScript?

Title: Re: How to simulate C's function pointer in AppleScript?
Have you tried declaring it as global ?

Best,

j.

Jay Louvion
Studio Casagrande
3, rue Müller-Brun
1208 Geneva

T+4122 840 3272
F+4122 840 3271

www.studiocasagrande.com

P Please consider the environment before printing this email.


On 23.10.2008 12:58, "André Berg" <email@hidden> spake thus:

Hi,

Ok, that may not be the best question formulated, but let me give you
a quick background to the question, if I may:

I have a Timer class, er .. I meant a Timer script object that is inside the top-level script,
like so:

script Timer
   
    property statement : "the statement to execute"
    
    -- ... stuff ...
   
    -- ... somewhere further down ...
   on timeit()
        run script my statement
   end timeit
   
    -- ... stuff ...
   
end script

Now I have the function I want to time also defined within the toplevel script, in fact physically
it comes just before the Timer script:

on myHandlerToTime()
    -- do something
end

The question now is how can I correctly pass, from the top-level script, myHandlerToTime()
in the statement property of the Timer script so that it gets used as the direct parameter
to the run script command inside the Timer script?

If I do this:

set Timer's statement to "set R to myHandlerToTime()"
Timer's timeit()

Then of course I get an error like:

"script doesn't understand the myHandlerToTime message."

Of course "run script" does not see the function... I need to give it a proper reference to
myHandlerToTime(). I tried various forms of its, my, property : parent, property : me,
parent's parent's but I am running out of ideas.

Any help would be appreciated.


Thanks for reading!

André


_______________________________________________
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

 _______________________________________________
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

References: 
 >How to simulate C's function pointer in AppleScript? (From: AndrĂ© Berg <email@hidden>)

  • Prev by Date: How to simulate C's function pointer in AppleScript?
  • Next by Date: Re: How to simulate C's function pointer in AppleScript?
  • Previous by thread: 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