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
1 |
<span>dwcontrol</span>.Object.<span>columnname</span> {.<span>buffer</span> } {.<span>datasource</span> } [ <span>startrownum</span>, <br> <span>endrownum</span> ] |
Parameter |
Description |
---|---|
dwcontrol |
The name of the DataWindow control or |
columnname |
The name of a column or computed field |
buffer |
The name of the buffer from which you
|
datasource |
The source of the data. Values are:
|
startrownum |
The number of the first row in the desired |
endrownum |
The number of the last row in the desired The row numbers must be enclosed in brackets and separated |
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:
1 |
dw_1.Object.empname[22,22] |
Examples
Because the primary buffer and current data are the default,
these expressions are all equivalent:
1 |
dw_1.Object.emp_name[11,20] |
1 |
dw_1.Object.emp_name.Primary[11,20] |
1 |
dw_1.Object.emp_name.Current[11,20] |
1 |
dw_1.Object.emp_name.Primary.Current[11,20] |
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:
1 |
string ls_empty[] |
1 |
ls_empty[1] = "" |
1 |
dw_1.Object.emp_name[11,20] = &<br> {"","","","","","","","","",""} |
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:
1 |
string ls_namearray[] |
1 |
ls_namearray = dw_1.Object.emp_name.Original[11,20] |
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:
1 |
string ls_namearray[] |
1 |
ls_namearray = dw_1.Object.emp_name.Filter[5,8] |
This statement gets original values of emp_name instead
of current values, as shown in the previous example:
1 |
string ls_namearray[] |
1 |
ls_namearray = &<br>dw_1.Object.emp_name.Filter.Original[5,8] |
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:
1 |
string ls_namearray[] |
1 |
ls_namearray = dw_1.Object.emp_name.Delete[50,200] |
This statement gets original values of emp_name instead
of current values, as shown in the previous example:
1 |
string ls_namearray[] |
1 |
ls_namearray = & |
1 |
dw_1.Object.emp_name.Delete.Original[50,200] |