Accessing
DataWindow object property values in code
Two techniques
There are two ways to access property values in a DataWindow
object:
-
Methods
The Describe and Modify methods use strings to specify the
property names. For example:12dw_1.Describe("empname.Border")dw_1.Modify("empname.Border=1") -
Expressions
DataWindow property expressions use the Object property and
dot notation. For example:12dw_1.Object.empname.Border = 1li_border = Integer(dw_1.Object.empname.Border)
In JavaScript, only the Describe and Modify methods are
available.
Which technique to use
The technique you use depends on the type of error checking you
want to provide and on whether you know the names of the controls and
properties you want to access when the script is compiled.
|
If you want to |
Use |
|---|---|
|
Use column and property names that are known when |
An expression |
|
Avoid extra nested tildes (and you know the column |
An expression |
|
Build a string at runtime that names controls and |
A method |
|
Use the DWRuntimeError to handle problems with |
An expression in a try-catch block |
|
Use the Error event to handle problems with |
An expression and a script for the Error |
|
Avoid using the Error event (or DWRuntimeError) for |
A method and code that evaluates its return |