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 Manipulate Data in Dynamic FieldsIf data has not been declared, the UnDeclareData method returns an error(nonzero value). Similarly, invoking the DeclareData method on an object forwhich data has already been declared (either a variable was declared for thetable field in OpenROAD Workbench or with the DeclareData method) returnsan error. Moreover, if a variable was declared for the table field in Workbench,you cannot later undeclare and redeclare the data.How You Can Manipulate Data in Dynamic FieldsIf a field was created with a declared variable in OpenROAD Workbench, youaccess the field's data value by using the name of the field as a variable.For example, assume that salary is the name of a field with data type moneyand dollars is a variable declared with the same data type. The followingstatements are valid:salary = salary * 1.15;dollars = salary;salary = dollars + 5.25;You cannot perform these calculations as easily when working with adynamically created field. To access the value of a dynamically created field,you must invoke a method on the field or use a dynamic expression(DynExpr).For a discussion of accessing values in dynamically created fields, see How YouCan Set and Get Simple Field Values (see page 382) and How You Can AccessIndividual Cells of a Dynamic Table Field (see page 385).How You Can Set and Get Simple Field ValuesOpenROAD provides the following methods for manipulating data in simpledynamic fields:• SetFieldValue• GetFieldValueFor example, assume that the field is a dynamic entry field whose Nameattribute has been set to salary. Moreover, assume you want to perform asimple calculation, equivalent to the following statement's multiplication of thevalue in a statically created field named salary:salary = salary * 1.15;382 <strong>Programming</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!