12. Inter-Frame Communication Techniques : Communicating Between OpenROAD Frames : How You Can Communicate Between Frames Using User Events : Message Parameters
 
Share this page                  
Message Parameters
The four optional message parameters of the SendUserEvent method, messageinteger, messagefloat, messagevarchar, and messageobject, let you pass values to the receiving frame. If the SendUserEvent method triggers a user event block, OpenROAD stores the values in the corresponding message attributes of the receiving frame's FrameExec object, MessageInteger, MessageFloat, MessageVarchar, and MessageObject. If the SendUserEvent method completes a WaitFor call in the receiving frame, OpenROAD stores the values in the Event object returned by the WaitFor call when it completes.
Use the three simple-variable parameters, messageinteger, messagefloat, and messagevarchar, to pass integer, float, and varchar values, respectively. The following example uses the messagevarchar parameter to send the title of the video to a frame:
on setvalue video.title =
begin
    CurFrame.WindowTitle = video.title;
    if graphic_frame is not null then
        graphic_frame.SendUserEvent
        (eventname= 'UpdateTitle',
        messagevarchar = video.title);
    endif;
end;
Use the messageobject parameter to pass any object. Because the object can be any system or user class, this parameter enables you to send any set of information that you want. This is especially useful with user classes. Simply create a user class that specifies the set of data you want to pass and then use the messageobject parameter to pass an object of that class. The following example uses this technique to pass information about a new video to the video_list frame. New_video is a reference variable of the video_row user class.
parent_frame.SendUserEvent(eventname =
    'InsertEntry',messageobject = new_video);
In the receiving frame, you can access the object with the MessageObject attribute for CurFrame (described in UserEvent Event Block (see UserEvent Event Block)).