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 Manage Operations with a Control ButtonThe following code assigns a new value to the same cell in tbl, using the samedynamic expression:intvar = intvar * 1.15;status = dexp.SetValue(value = intvar);You can get a value from the cell and assign a new one in a single step usingthe Assign method. Because the Assign method assigns the value of onedynamic expression to another, you can use this method to copy valuesbetween dynamic expressions without knowing the data type of the value ineach expression.For example, the following code creates two dynamic expressions, onecontaining the current value of the specified cell and the other containing thatvalue increased by 15 percent, and then assigns the value of the seconddynamic expression to the first:txt = 'tbl[i].' + CurFrame.TriggerField.Name;dexp_a = CurFrame.Scope.CreateDynExpr(string = txt,errors = byref(errstr));txt = txt + '* 1.15';dexp_b = CurFrame.Scope.CreateDynExpr(string = txt,errors = byref(errstr));status = dexp_a.Assign(fromdynexpr = dexp_b);Although using the Assign method in this manner requires creating twodynamic expressions, it eliminates the need for an intermediate variable.How You Can Manage Operations with a Control ButtonIf you want a Control Button to manage operations on the dynamic table field,create the control button in OpenROAD Workbench as an independent object.Dynamically created table fields, as well as table fields created in Workbenchbut changed dynamically, cannot use the script supplied with a control button.For the script of a table field's control button to be available to a runningframe, the script must be compiled before the frame runs. If the table field iscreated with its variable declared (Variable Declared property set to on), itscontrol button's script is compiled. However, table fields created withoutdeclaring the variable (a requirement of dynamically created or modified tablefields) are created with empty control button scripts.Even moving the control button's script into the frame script does not makethe script available to the running frame if the table field has been createdwithout declaring its variable.Creating Dynamic Frames 389

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

Saved successfully!

Ooh no, something went wrong!