10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Communicating Between OpenROAD FramesHow You Can Communicate Between Frames Using User EventsYou can utilize user events to communicate between two frames by performingthe following basic steps:1. Write the event block for the user event in one frame script.The event block for the user event contains the code that is executed whenthe user event is triggered.2. Include in the other frame script the SendUserEvent method to trigger theuser event in the first frame.When the SendUserEvent method is executed, OpenROAD places the specifieduser event in the native event queue. From there, OpenROAD dispatches theuser event to the appropriate frame. The code for the user event is executedwhen the event reaches the top of the frame's event queue. The followingillustration demonstrates this:You can also have one frame send a user event to itself. For example, a framethat displays a clock can send an event to itself at regular intervals to updatethe clock. For an example of this, see Delay Parameter (see page 342).Because the events in event queues are processed one at a time, the eventblock that places the user event in the native event queue (that is, the eventblock that contains the SendUserEvent method) completes before the userevent is processed. If you want to force the event block that sends the userevent to complete after a specified user event, use the WaitFor method. TheWaitFor method prevents the current event block from being executed until thecurrent frame receives the specified user event. For more information, seeWaitFor Method (see page 345).If necessary, you can remove a user event from an event queue with thePurgeUserEvent method. For more information, see PurgeUserEvent Method(see page 347).336 <strong>Programming</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!