Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Advantage and drawbacks of Modify and Describe methods in PowerBuilder – PB Docs 2021 – PowerBuilder Library

Advantage and drawbacks of Modify and Describe methods in PowerBuilder – PB Docs 2021

Advantage
and drawbacks of Modify and Describe methods in PowerBuilder

In PowerBuilder, using the Describe and Modify methods to access
DataWindow object property values has an advantage and some drawbacks.
The examples here use Modify as illustrations, but similar
considerations apply to Describe.

Advantage

Allows you to specify column and property
names dynamically

In your script, you can build a string that specifies the column
and property names.

For example, the following code builds a string in which the
default color value and the two color values in the If function are
determined in the script. Notice how the single quotes around the
expression are included in the first and last pieces of the
string:

The resulting string when red_amount is set to 128 is:

The following is a simpler example without the If function. You do
not need quotes around the value if you are not specifying an
expression. Here the String and RGB functions result in a constant value
in the resulting modstring:

Drawbacks

Setting several properties at once is
possible but hard to debug

Although you can set several properties in a single method call,
it is harder to understand and debug scripts that do so.

For example, assume the following is entered on a single line in
the script editor:

Less efficient than an
expression

Using a DWObject variable in several property expressions is a
little more efficient than setting several properties in a single call
to Describe or Modify. However, if you want to be able to name controls
dynamically, you might still choose to use Describe or Modify.

For examples of using a DWObject variable, see Using the DWObject variable in
PowerBuilder
.

Can require complex quoted
strings

When you specify an expression for a property value, it is
difficult to specify nested quotes correctly — the code is hard to
understand and prone to error. For Describe, this is less of a drawback
— strings do not become as complex because they do not include an
expression.

For example, this string entered on a single line in a script
assigns a DataWindow expression to the Color property:

For more information about quoted strings, see Nested strings and special
characters for DataWindow object properties
.


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x