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 Manipulate Data in Dynamic FieldsHow You Can Set and Get Values with Dynamic ExpressionsYou can use the following methods to get and set values in the field referencedby a dynamic expression:• GetValue to obtain the value from the field• SetValue and Assign to change values in the fieldThe GetValue method reevaluates the expression that was specified when theDynExpr object was created and places the value of the dynamic expression inthe specified variable.For example, to get the value of a dynamic expression that was created for afield whose data type is money, create a money variable and invoke DynExpr'sGetValue method to get the value from the dynamic expression and load it intothe money variable.The following statement performs this operation:status = dexp.GetValue(value = byref(money_var));If the GetValue method succeeds, status is set to ER_OK; if it fails, it is set tosome other integer value.Setting a value in a dynamic expression works similarly. Use DynExpr'sSetValue method to load a value from a valid OpenROAD expression into adynamic expression.The following code sets the value of the dynamic expression from a variableparameter to the SetValue method:status = dexp.SetValue(value = money_var);Like the GetValue method, the SetValue method sets status to ER_OK ifsuccessful; if it fails, it sets status to some other integer value.The SetValue method is valid only if the expression specified when thedynamic expression was created was not a computed expression. TheGetValue method is valid only if the expression specified when the dynamicexpression was created represents a field or table field cell.You can get a value from a dynamic expression and assign a new one in asingle step using the Assign method. For an example of using the Assignmethod, see How You Can Get Values from Unknown Fields (see page 388).Creating Dynamic Frames 387

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

Saved successfully!

Ooh no, something went wrong!