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 Declare a Composite Field's Array Variable DynamicallyBecause table fields must always contain at least one column, you can neverdelete all columns from a table field. Therefore, replacing all of a table field'scolumns with another set of columns requires the following steps:1. Delete all but one column.2. Add the new columns.3. Remove the last of the original columns.The following code performs these operations:for i = tfield.TableBody.ChildFields.LastRow downto2 do tfield.DeleteColumn(position = i);endfor;insert new columns, beginning with position 1tfield.DeleteColumn(position =tfield.TableBody.ChildFields.LastRow);How You Can Declare a Composite Field's Array VariableDynamicallyTo change the fields in a composite field or the columns in a table fielddynamically at runtime, the composite field (including table fields) must havebeen created without a variable declared. Only after the composite field hasbeen modified to contain the required fields or columns should you use theDeclareData method to declare a user class or array variable for it.Moreover, to change the fields of a composite field or the columns of a tablefield whose user class or array variable has been dynamically declared, use theUnDeclareData method to remove the current user class or array beforechanging the fields or columns and declaring a new user class or array.The following sections describe dynamically declaring and undeclaring an arrayvariable for a table field.How You Can Declare and Undeclare DataBefore you can load data into a dynamically created or modified table field,perform the following operations:1. Attach the table field to the form by parenting it (if it is not alreadyparented).2. Specify the table field's underlying array with the DeclareData method.380 <strong>Programming</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!