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

Accessing the items in a DataWindow – PB Docs 2021 – PowerBuilder Library

Accessing the items in a DataWindow – PB Docs 2021

Accessing the items in a DataWindow

You can access data values in a DataWindow by using methods or
DataWindow data expressions. Both methods allow you to access data in
any buffer and to get original or current values.

The method you use depends on how much data you are accessing and
whether you know the names of the DataWindow columns when the script is
compiled.

For guidelines on deciding which method to use, see Accessing Data in Code in DataWindow Reference.

Using methods

There are several methods for manipulating data in a DataWindow
control.

These methods obtain the data in a specified row and column in a
specified buffer:

  • PowerBuilder

    GetItemDate, GetItemDateTime, GetItemDecimal, GetItemNumber,
    GetItemString, GetItemTime

This method sets the value of a specified row and column:

  • PowerBuilder

    SetItem

For example, the following statement, using PowerBuilder syntax,
assigns the value from the empname column of the first row to the
variable ls_Name in the Primary buffer:

This PowerBuilder statement sets the value of the empname column
in the first row to the string Waters:

Uses

You call the GetItem methods to obtain the data that has been
accepted into a specific row and column. You can also use them to check
the data in a specific buffer before you update the database. You must
use the method appropriate for the column’s datatype.

For more information about the methods listed above, see Methods for the DataWindow Control in DataWindow Reference.

Using expressions

DataWindow data expressions refer to single items, columns, blocks
of data, selected data, or the whole DataWindow.

In PowerBuilder, you construct data expressions using dot
notation.

Expressions in
PowerBuilder

The Object property of the DataWindow control lets you specify
expressions that refer directly to the data of the DataWindow object in
the control. This direct data manipulation allows you to access small
and large amounts of data in a single statement, without calling
methods:

The next statement sets the value of the first column in the first
row in the DataWindow to Smith:

For complete instructions on how to construct DataWindow data
expressions, see Accessing Data in Code in DataWindow Reference.


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