10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Communicating Between OpenROAD FramesOpenROAD triggers the user event after the specified time has elapsed. In themeantime, OpenROAD continues executing the current event block, and eventscan continue to be triggered in any of the currently active frames. The defaultdelay is 0.0 seconds (in other words, the event is triggered immediately).In the following example, we use the delay parameter to update a block every10 seconds:initialize =beginCurFrame.SendUserEvent (eventname= 'clock');end;on userevent 'clock' =begincurrent_time = date('now');CurFrame.SendUserEvent(eventname= 'clock',delay = 10.0);endErrorevent ParameterThe errorevent parameter specifies a user event that is returned to thesending frame by the system if the current user event cannot be delivered.The following examples demonstrate how to use this parameter.The following code would be in the sending frame:declareresponse = Event;enddeclarebegintargetframe.SendUserEvent (eventname = 'originalevent',errorevent = 'replyevent');response = CurFrame.WaitFor (eventname = 'replyevent');if response.MessageErrorCode = 0 then/*** The target frame received** and replied.*/...else/*** The target frame never got the** event.*/...endif;end;Inter-Frame Communication Techniques 343

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

Saved successfully!

Ooh no, something went wrong!