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 FieldserrorsFor example, the following statement creates a dynamic expression (dexp)that contains the value of a cell in the Salary column of a table field namedtbl:declaredexp = DynExpr default null;enddeclaredexp = CurFrame.Scope.CreateDynExpr(string ='tbl[i].Salary');When the dynamic expression is used in a GetValue, SetValue, or Assignmethod invocation, the value of i must be a valid row number for thearray.The value of the string parameter is evaluated within the context of thenamed scope. In the previous statement, the dexp dynamic expression isvalid while the current frame is running. The scope in the followingstatement limits the dynamic expression to the current event block:declaredexp = DynExpr default null;enddeclaredexp = CurEventScope.CreateDynExpr(string ='tbl[i].Salary');Any attempt to use the dynamic expression after the event blockterminates causes a runtime error.(Optional.) Provdes the text of the error message. If the scope object onwhich the CreateDynExpr method is invoked is invalid, or the text specifiedin the string parameter cannot be compiled, the CreateDynExpr methodreturns a null.If compilation errors occur, the CreateDynExpr method creates a stringobject containing the errors and sets the variable specified by the errorsparameter (of StringObject data type) to point to that string object. If nocompilation errors occur, this parameter is set to null.The following statement creates a dynamic expression and sets the errorsparameter:declaredexp = DynExpr default null;enddeclaredexp = CurFrame.Scope.CreateDynExpr(string ='tbl[i].Salary', errors = byref(stringvar);If an error occurs creating the dexp dynamic expression, the stringvarvariable contains the error message in its Value attribute.386 <strong>Programming</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!