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

dwcontrol.Object.Data {.buffer } {.datasource } { [ rownum ] }

Parameter

Description

dwcontrol

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

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.

rownum (optional)

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:

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:

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:

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:

dw_1.Object.NestRep[2].Object.Data = &

		dw_2.Object.Data