Accessing DataWindow object property values in code

Two techniques

There are two ways to access property values in a DataWindow object:

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.

Table 5-2: Error handling in DataWindow property expressions

If you want to

Use

Use column and property names that are known when the script is compiled

An expression

Avoid extra nested tildes (and you know the column and property names you want to access)

An expression

Build a string at runtime that names controls and properties

A method

Use the DWRuntimeError to handle problems with incorrect control or property names

An expression in a try-catch block

Use the Error event to handle problems with incorrect control or property names

An expression and a script for the Error event

Avoid using the Error event (or DWRuntimeError) for handling problems with incorrect control or property names

A method and code that evaluates its return value