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.
There are several variations of data expression syntax, divided into three groups. This section summarizes these syntaxes. The syntaxes are described in detail later in this chapter.
One or all items (if rownum is absent, include either buffer or datasource)
dwcontrol.Object.columnname {.buffer } {.datasource } { [ rownum ] }
Returns a single value (for a specific row number) or an array of values (when rownum is omitted) from the column.
See “Syntax for one or all data items in a named column”.
dwcontrol.Object.columnname {.Primary }{.datasource }.Selected
Returns an array of values from the column with an array element for each selected row.
See “Syntax for selected data in a named column”.
dwcontrol.Object.columnname {.buffer } {.datasource } [ startrownum, endrownum ]
Returns an array of values from the column with an array element for each row in the range.
See “Syntax for a range of data in a named column”.
dwcontrol.Object.Data {.buffer } {.datasource } [ rownum, colnum ]
Returns a single item whose datatype is the datatype of the column.
See “Syntax for a single data item in a DataWindow”.
Blocks of data involving a range of rows and columns
dwcontrol.Object.Data {.buffer } {.datasource } [ startrownum, startcolnum, endrownum, endcolnum ]
Returns an array of structures or user objects. The structure elements match the columns in the range. There is one array element for each row in the range.
See “Syntax for data in a block of rows and columns”.
dwcontrol.Object.Data {.buffer } {.datasource } { [ rownum ] }
Returns one structure or user object (for a single row) or an array of them (for all rows). The structure elements match the columns in the DataWindow object.
See “Syntax for data in a single row or all rows”.
dwcontrol.Object.Data {.Primary } {.datasource } .Selected
Returns an array of structures or user objects. The structure elements match the columns in the DataWindow object. There is one array element for each selected row.
See “Syntax for all data from selected rows”.
This diagram summarizes the variations in data expression syntax:
Figure 4-1: Variations in data expression syntax
For information about getting and setting values of DataWindow object properties using a similar syntax, see Chapter 5, “Accessing DataWindow Object Properties in Code.”