Syntax for a range of data in a named column – PB Docs 126

Syntax for a range of data in a named column

Description

A DataWindow data expression accesses values in a named column
or computed field for a range of rows when you specify the starting
and ending row numbers.

Syntax

Parameter

Description

dwcontrol

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

columnname

The name of a column or computed field
in the DataWindow object in dwcontrol. If the
column or computed field does not exist at runtime, an execution
error occurs.

buffer
(optional)

The name of the buffer from which you
want to get or set data. Values are:

  • Primary – (Default)
    The data in the primary buffer (the data that has not been deleted
    or filtered out).

  • Delete – The data in the delete buffer
    (data deleted from the DataWindow control).

  • Filter – The data in the filter buffer
    (data that was filtered out).

datasource
(optional)

The source of the data. Values are:

  • Current – (Default)
    The current values in the DataWindow control.

  • Original – The values that were initially
    retrieved from the database. For a computed field, you must specify
    Original (because computed fields cannot be changed and do not have current
    values).

startrownum

The number of the first row in the desired
range of rows.

endrownum

The number of the last row in the desired
range of rows.

The row numbers must be enclosed in brackets and separated
by commas.

Return value

The datatype of the expression is Any. The expression returns
an array of values with an array element for each row in the range.
Each value’s datatype is the datatype of columnname.

Usage

When you specify a range, the expression always returns an
array and you must assign the result to an array, even if you know
there is only one value in the result. For example, this expression
returns an array of one value:

Examples

Because the primary buffer and current data are the default,
these expressions are all equivalent:

This example resets the emp_name value in rows 11
through 20 to an empty string. Rows 12 to 20 are set to a default
value, which may be an empty string:

This statement gets the original emp_name values
in rows 11 to 20 and assigns them to elements 1 to 10 in an array
of strings:

This statement gets current values of emp_name from
rows 5 to 8 in the Filter buffer and assigns them to elements 1
to 4 in an array of strings:

This statement gets original values of emp_name instead
of current values, as shown in the previous example:

This statement gets current values of emp_name from
rows 50 to 200 in the delete buffer and assigns them to elements
1 to 151 in an array of strings:

This statement gets original values of emp_name instead
of current values, as shown in the previous example:


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