Basic syntax for DataWindow property expressions in PowerBuilder – PB Docs 126

Basic syntax for DataWindow property expressions in PowerBuilder


DataWindow property expressions in PowerBuilder use dot notation
to specify the controls and properties that you want to access.





The name of the DataWindow control or
child DataWindow in which you want to get or set properties.


Object indicates that subsequent elements
refer to the DataWindow object within dwcontrol.


a control within the DataWindow object.
Possible values are DataWindow (for properties that apply to the
whole DataWindow) or the name of a column, computed field, graph,
line, oval, picture, rectangle, roundrectangle, report, TableBlob,
or text control.

note.png Nested DataWindow objects

If dwcontrolname is a column with the
DropDownDataWindow style, a report, or an OLE Object control, you
can specify another Object keyword and dwcontrolname to
refer to properties of controls within the nested DataWindow object.
You can specify Object.dwobjectname as many
times as needed to refer to a deeply nested report.

For nested syntax, see “Syntax for nested objects
in DataWindow property expressions in PowerBuilder”


A property that applies to dwcontrolname.
If the property requires additional qualifying properties, list
the additional properties, separating them with a dot.

For lists of applicable properties, see the
Property tables at the beginning of Chapter
38, “DataWindow Object Properties.”


A string whose value is to be assigned
to the property.

If the property value is a number, value can
either be a string whose value is a number or a numeric datatype.
The value is stored as a string.

If the property value is a yes or no value, value can
be either a string whose value is “yes” or “no” or a boolean value
(true or false). The value
is stored as “yes” or “no” strings.

If the property value can be an expression, then value can
be a string that takes the form:


  • Defaultvalue is
    any value that is allowed for property.

  • DataWindowexpression is an
    expression that can include names of controls in the DataWindow
    and DataWindow expression functions.

  • Defaultvalue and DataWindowexpression are
    separated by a tab character (~t).

For examples of DataWindow expressions, see “Using DataWindow expressions
as property values”


Any. The datatype of the expression is Any, but actual data
is a string.

For more information about the expression’s
datatype, see “Datatypes of DataWindow
property expressions in PowerBuilder”


Example 1 Boolean property values In
this statement, the boolean value false is stored as the string

This statement displays the value of the ReadOnly property
(either “yes” or “no”) in the StaticText st_status:

When you test the value of a property in a relational expression,
you must compare your test value to the stored values. For ReadOnly,
stored values are yes or no, not boolean true or false:

This statement fails because the expression is not boolean:

Example 2 Valid values for the
Visible property are 0 and 1. You can set the property to numbers,
yes and no, or true and false.
Therefore, these three statements are equivalent:

Example 3 This example tests
whether the X property contains a constant (which can be converted
to a number) or a DataWindow expression. The code assigns a default
value of 50 to the variable li_x, which remains the value
if the property contains an expression the script cannot convert:

Example 4 This script sets the
X property to a DataWindow expression. The expression causes IDs
with values less than 10 to be indented:

Example 5 This example makes
three columns updatable and reports the value of the Update property
in the StaticText st_status. The reported value is “yes,” not true:

Example 6 This example checks
whether the id column is set up as a spin control. If so, it sets
the spin range to 0 through 10:

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