Syntax for data in a single row or all rows
Description
A DataWindow data expression accesses a single row when you
specify the row number. It accesses all the data in the DataWindow
control when you omit the row number.
Syntax
|
1 |
<span>dwcontrol</span>.Object.Data {.<span>buffer</span> } {.<span>datasource</span> } { [<span> rownum</span> ] } |
|
Parameter |
Description |
|---|---|
|
dwcontrol |
The name of the DataWindow control or |
|
buffer |
The name of the buffer from which you
|
|
datasource |
The source of the data. Values are:
|
|
rownum |
The number of the row you want to access. To access data for all rows, omit rownum. The row number must be enclosed in brackets. |
Return value
The datatype of the expression is Any. The expression returns
one structure or user object (for a single row) or an array of them
(for all rows). There is one structure element or instance variable
for each column in the DataWindow object. The datatype of each element
matches the datatype of the corresponding column.
Usage
When you omit the row number, the expression always returns
an array, and you must assign the result to an array, even if you
know there is only one row in the DataWindow control.
Examples
These statements both access current data for row 5 in the
primary buffer in the DataWindow object contained in the DataWindow
control dw_1:
|
1 |
dw_1.Object.Data[5] |
|
1 |
dw_1.Object.Data.Primary.Current[5] |
This example assigns all the data in dw_1 to the
Any variable la_dwdata. The value assigned to la_dwdata
is an array of data structures whose members match the column datatypes:
|
1 |
any la_dwdata |
|
1 |
la_dwdata = dw_1.Object.Data |
This example assigns all the data in the delete buffer for
dw_1 to the Any variable la_dwdata:
|
1 |
any la_dwdata |
|
1 |
la_dwdata = dw_1.Object.Data.Delete |
This example replaces all the data in the nested report in
row 2 with data from dw_2. The columns in the DataWindow
object in dw_2 must match the columns in the DataWindow
object for the nested report:
|
1 |
dw_1.Object.NestRep[2].Object.Data = & |
|
1 |
dw_2.Object.Data |