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 DynamicallyHow You Can Execute the FrameThe reference to a previously non-existent row automatically appends a new,empty row to the end of the array. After the row has been added, each of itsattributes is assigned the appropriate value for the newly generated frame.The process used to add a new row in the example code is called adding a rowby first reference. For more information about adding rows to an array, seeWorking with Arrays, Table Fields, and Collections (see page 205).The following code from the DynamicFrame frame assigns a name to the newlygenerated frame and executes it:test_frame_name = table_choices + '_frame';callframe :test_frame_name;The callframe statement compiles and runs the new frame. When OpenROADautomatically compiles a dynamically created frame or procedure on first call,it places the text of any compilation errors into Proc4GLSource'sCompile_Errors attribute. Check whether the Compile_Errors attribute is nullafter the first call to detect whether compilation errors occurred.The following code from the example frame checks the Compile_Errorsattribute and writes any errors to a file to facilitate debugging:if test_frame.Compile_Errors is not null thentest_frame.Compile_Errors.WriteToFile('test.errors');Generated_Frame_List.RemoveRow(rownumber = i);endif;If the frame does not compile correctly, its name is removed from the list inthe global array variable, Generated_Frame_List.Close Menu ItemIn addition to the File menu option, the DynamicFrame application's startingframe has a Close menu option. The event code for the Close menu itemcontains only the return statement to terminate the application. The followingcode is the complete Close event block:on click menu.file_menu.close_menu =beginreturn;end;Creating a Frame at Runtime 417

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

Saved successfully!

Ooh no, something went wrong!