Optimizing expressions for DataWindow and external objects – PB Docs 70

Optimizing expressions for DataWindow and external objects

No compiler validation for container objects

When you use dot notation to refer to a DataWindow object
in a DataWindow control or DataStore, the compiler does not check
the validity of the expression:

Everything you specify after the Object property passes the
compiler and is checked during execution.

The same applies to external OLE objects. No checking occurs
until execution:

Establishing partial references

Because of the execution-time syntax checking, using many
expressions like these can impact performance. To improve efficiency
when you refer repeatedly to the same DataWindow component object
or external object, you can define a variable of the appropriate
type and assign a partial reference to the variable. The script
evaluates most of the reference only once and reuses it.

The data type of a DataWindow component object is DWObject:

The data type of a partially resolved automation expression
is OLEObject:

Handling errors

The Error event and (for automation) the ExternalException
event are triggered when errors occur in evaluating the DataWindow
and OLE expressions. If you write a script for these events, you
can catch an error before it triggers the SystemError event. These
events allow you to ignore an error or substitute an appropriate
value. However, you must be careful to avoid setting up conditions that
cause another error.

For information

For information about DataWindow data expressions and property expressions,
DWObject variables, and handling errors, see the DataWindow Reference

For information about using OLEObject variables in automation
and handling errors, see Chapter 17, “Using OLE in an Application “.

Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x