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 FramesWaitFor MethodUsually, when you use the SendUserEvent method, OpenROAD queues theuser event and then continues executing the current event block. The WaitFormethod lets you prevent the rest of the current event block from beingexecuted until you tell it to stop waiting.When you invoke the WaitFor method, you specify the name of a user eventthat the event block must wait for. When the current frame receives that userevent, control returns to the statement immediately following the WaitFor call.The syntax of the WaitFor method is:event = CurFrame.WaitFor(eventname = varchar)You can use the WaitFor method for the current frame only with the CurFramereference variable. The method returns an Event object that contains theeventname, messageobject, messageinteger, messagefloat, and messagevarchar parameters sent with the SendUserEvent call that completes themethod. (When the SendUserEvent call completes a WaitFor call, theSendUserEvent focusbehavior parameter is ignored in the receiving frame.)WaitFor makes the executing frame ignore any other events, both from theuser and other SendUserEvent methods. Window-level events, such as buttonclicks, are disabled. User events are delivered to the frame after it receives theuser event that it is waiting for.Important! Do not use the WaitFor method when you are sending the userevent from the current frame to itself. The user event is never delivered to theframe and the event block is never continued. This results in the frameremaining in an unending wait state.The most common use of the WaitFor method is immediately following aSendUserEvent method to wait for acknowledgment that the user event wasprocessed. This is especially useful when coordination of frames is important.Inter-Frame Communication Techniques 345

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

Saved successfully!

Ooh no, something went wrong!