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 |
dwcontrol.Object.Data {.buffer } {.datasource } { [ rownum ] } |
|
Parameter |
Description |
|---|---|
|
dwcontrol |
The name of the DataWindow control or child |
|
buffer (optional) |
The name of the buffer from which you want to get
|
|
datasource (optional) |
The source of the data. Values
|
|
rownum (optional) |
The number of the row you want to To access data for all rows, omit The row number must be enclosed in |
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 2 |
dw_1.Object.Data[5] 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 2 |
any la_dwdata 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 2 |
any la_dwdata 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 2 |
dw_1.Object.NestRep[2].Object.Data = & dw_2.Object.Data |