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 Build a Frame DynamicallyGenerated_Frame_List is a global array variable used by the exampleapplication to keep track of frames that have already been generated, avoidingthe need to regenerate them. The LastRow attribute, defined for array objects,returns the sequence number of the last row in the array. If the LastRowattribute returns any positive number in the preceding code, the code checksthe Generated_Frame_List array for a table name that matches the user'schosen table. If a match is found, that frame is executed.If no rows exist in the Generated_Frame_List variable or if no match is found,the starting frame code constructs a frame. The construction proceeds in thefollowing order:1. Create the FrameSource object and define its attributes.2. Create the FrameForm object.3. Construct the fields on the form.4. Set the height and width of the form.5. Complete the statement strings.6. Create the menu items.7. Generate the frame script for the frame.8. Add the frame to the application.After the frame is generated, it can be executed.The following subsections describe each of these steps in detail.How You Can Create the FrameSource ObjectThe first step in the construction of a frame is the creation of its FrameSourceobject, which contains the source definition of a frame. The attributes of theFrameSource object represent the initial settings of the frame when it is firstcalled or opened. The example application creates the FrameSource with thefollowing code:/* No frame found. Generate a new one. */fieldtop = 200; /* Starting field on frame */test_frame = FrameSource.Create();The Create method creates a new instance of an object of the specified class.In this case, it returns a new instance of a FrameSource object to thetest_frame reference variable.Creating a Frame at Runtime 403

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

Saved successfully!

Ooh no, something went wrong!