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.

How You Can Invoke FramesUsing the byref keyword to pass a reference or array variable lets you reassignthe variable (a pointer) to a different object in the called frame and have thatreassignment visible in the calling frame. The previous example shows how thearray_var parameter is passed to myframe by reference. Consequently, ifmyframe reassigns the movies array variable to point to a different object,when myframe closes, array_var in the calling frame will also point to the newobject.In all cases, no changes reflected in the calling frame are visible until thecalled frame closes. At this point, the variable in the calling frame is updatedthe same way it would be if you had used an assignment statement. That is, ifthere is a field associated with the variable, it does not display the new valueuntil the current event block completes. To cause the value to be updatedbefore the end of the event block, use the Flush method immediately after thecallframe statement. For more information about the Flush method, see theLanguage Reference <strong>Guide</strong> online help.How You Can Open Concurrent Frames: Openframe StatementThe openframe statement opens a second frame while keeping the callingframe active. Use the openframe statement when you want to createconcurrent frames.The frame that you open with an openframe statement is considered a child ofthe calling frame. OpenROAD automatically terminates the child frame whenthe parent frame terminates. For example, if the user closes the video_listframe, which calls the video_detail frame, OpenROAD also closes video_detail.When you use the openframe statement, it is important to keep the activeframes synchronized. When the frames are displaying shared data, you mustensure that any changes that the user makes in one frame are reflected in theother open frames. For example, if the user makes a change in a called frame,the called frame can send a user event to the calling frame to inform it of thechange.When you first open the frame with the openframe statement, you can sendparameters as starting values for the new frame. After issuing the openframestatement, however, you must explicitly coordinate all subsequentcommunication between the frames. For more information about the processinvolved, see Inter-Frame Communication Techniques (see page 333).How You Can Pass Parameters Between Active FramesIf you pass an object as a parameter to the opened frame, you are actuallypassing the pointer to the object rather than the object itself. Therefore,because both the parent and child frames have pointers to the same object,any changes made to the object by the child frame are reflected in the parentframe.<strong>Programming</strong> Frames 103

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

Saved successfully!

Ooh no, something went wrong!