Language Reference Guide : Events : UserEvent Event
 
Share this page          
UserEvent Event
The UserEvent event is triggered by the SendUserEvent method of the GhostExec object for a frame.
This event has the following syntax:
on userevent ['eventname']
eventname is optional and can be any string of up to 32 characters, surrounded by quotes.
The following attributes of the FrameExec class can be used in the UserEvent event block:
EventName
Specifies the name of the event sent with the eventname parameter in the call to SendUserEvent
MessageInteger
Specifies the integer sent with the messageinteger parameter in the call to SendUserEvent
MessageFloat
Specifies the float sent with the messagefloat parameter in the call to SendUserEvent
MessageVarchar
Specifies the varchar sent with the messagevarchar parameter in the call to SendUserEvent
MessageObject
Specifies the object sent with the messageobject parameter in the call to SendUserEvent
Use the CurFrame system variable to access these attributes. For more information, see FrameExec Class.
Usage: You can specify this event only in a frame script. If you specify the event name, OpenROAD executes the event block when the frame receives that particular user event. If you do not specify an event name, OpenROAD executes the block when the frame receives any user event. You can specify any number of user event blocks in the frame script, although each must have a unique event name or no event name at all.
The UserEvent event communicates between concurrently active frames. This event is the primary way to communicate directly between two concurrently running frames within a single application.
You can use UserEvent events with the SendUserEvent method to do this. For example, you may want to tell Frame A that an update has occurred in some field on Frame B so that Frame B can update some corresponding field. When an update occurs, Frame A executes the SendUserEvent method, sending the event to Frame B. When Frame B receives the event, it executes the appropriate event block.
For more information about how to pass named parameters with userevents, see Sending User-named Parameters with Userevents and SendUserEvent Method.
When a user event is sent from one frame to another, the event is placed on the queue of events to be processed. These events are processed in order of placement on the queue, and each event is completed before the next event is processed. The event block that issued the SendUserEvent method, placing the event on the queue, finishes before that event is processed (unlike a call to a procedure).
When an event block issues a call to a procedure, the procedure completes before control returns to the event block, which then completes. You can use the WaitFor method defined for the FrameExec class to cause an event posting to behave in a manner similar to a procedure call.
Frames can also receive user events sent by other applications. For instructions to use user events in this way and information about using user events, see the Programming Guide.
More information:
EventName Attribute
MessageFloat Attribute
MessageInteger Attribute
MessageObject Attribute
MessageVarchar Attribute