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 FramesUserEvent Event BlockIn the UserEvent event block, you provide the code that is executed when theevent is triggered. The syntax is:on userevent ['eventname'] =declaredeclarationsend declare{}statement listeventnameSpecifies any string of up to 32 characters enclosed in quotes. If youspecify the event name, OpenROAD executes the event block wheneverthe frame receives that particular user event. If you do not specify anevent name, OpenROAD executes the block whenever the frame receives auser event for which the frame does not have an event block specified byname.For example, assume that a frame has event blocks for two user events,Event1 and Event2, and a general user event block that does not specify auser event name. When the frame receives Event1, OpenROAD executes theevent block specified for Event1. Similarly, if the frame receives Event2,OpenROAD executes the event block specified for Event2. OpenROAD does notexecute the generic event block in either case. However, if the frame receivesEvent3, for which the frame has no specific block, it executes the genericblock.You can specify any number of user event blocks in the frame script, althougheach must have a unique event name, or no event name at all.Because the SendUserEvent method and external user events both trigger userevent blocks, it is best to use appropriate naming conventions for your userevents. (There is no way to tell within the event block whether the event wastriggered by OpenROAD or by an external program.)The event block for the user event can contain any OpenROAD statements.The following event block is for the DeleteEntry user event:on userevent 'DeleteEntry' =begindelete_details_frame =FrameExec(CurFrame.MessageObject);Inter-Frame Communication Techniques 337

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

Saved successfully!

Ooh no, something went wrong!