2. Writing Scripts and Procedures : Scripts : Frame Scripts
 
Share this page                  
Frame Scripts
Each frame can have one frame script. In the frame script, you can do the following:
Initialize local variables for the frame
Perform any start-up operations for the frame
Include event blocks for events that apply to the frame as a whole
Include event blocks for events on individual fields or menu items
The general syntax of a frame script is:
[initialize [([parameterlist])] =
[declare
        [localvariablelist]
        [localprocedureforwardreferences]
[enddeclare]]
[begin
         statementlist
end [;]]
{eventblock [;]}
{localprocedure [;]}
{parameterlist [;]}
{localvariablelist [;]}
parameterlist
Specifies the following:
{variable = datatype {, variable = datatype}}
localvariablelist
Specifies the following:
{variable = datatype;}
The initialize statement contains the local variable definitions and start-up operations for the frame. The event blocks contain the code for the events for the frame, form fields, and menu items. You can include comments at any point in your script. For more information, see Comments.
Most applications have a frame script for each frame. However, if the frame needs no initialize statement, you can create the field and menu scripts separately and omit the frame script.