10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

How You Can Create and Modify Fields DynamicallyThe following code creates a matrix field, sets the number of rows andcolumns, populates the matrix field, and removes empty cells:mfield = MatrixField.Create();mfield.Rows = 25;mfield.Columns = 4;Loop through some array to get information abouteach field to be added. Create fields and set theirattributes....mfield.InsertChild(fieldtoinsert = trim,row = i, column = 1);mfield.InsertChild(fieldtoinsert = efields[j],row = i, column = 2);endfor;/* get rid of extraneous rows */mfield.CollapsePolicy = CP_ROWS;For more information about the CollapsePolicy attribute of the MatrixFieldsystem class, see the Language Reference <strong>Guide</strong> online help.How You Can Create Dynamic Table Fields and Table Field ColumnsYou can create table fields dynamically in the same way as other compositefields, or you can add new columns to an existing table field (so long as itsunderlying array has not been declared in OpenROAD Workbench).To add or remove columns dynamically from a table field created inWorkbench, the variable for the table field must not be declared until runtime.When you create the table field, set the Variable Declared property to off. Atruntime, add or remove the requisite columns. After the table field containsonly the desired columns, declare an array variable for the table field with theDeclareData method of the ActiveField system class.The following section describes the process of dynamically adding columns to atable field. For a discussion of dynamically removing table field columns, seeHow You Can Remove Columns from a Table Field (see page 379). For adiscussion of dynamically declaring the array variable for the table field, seeHow You Can Declare a Composite Field's Array Variable Dynamically (seepage 380).376 <strong>Programming</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!