GetItemNumber method (DataWindows)
Description
Gets numeric data from the specified buffer of a DataWindow
control or DataStore object. You can obtain the data that was originally
retrieved and stored in the database from the original buffer, as
well as the current value in the primary, delete, or filter buffers.

component
Separate method names, GetItemNumberEx, GetItemNumberByColNumEx, and GetItemNumberByColNum,
are provided as alternative syntaxes for the Web DataWindow server
component, which cannot use overloaded methods.
Controls
DataWindow type |
Method applies to |
---|---|
PowerBuilder |
DataWindow control, DataWindowChild object, DataStore |
Web |
Server component |
Web ActiveX |
DataWindow control, DataWindowChild object |
Syntax
[PowerBuilder]
1 |
numeric <span>dwcontrol</span>.<span>GetItemNumber</span> ( long <span>row</span>, string <span>column<br> </span> {, DWBuffer <span>dwbuffer</span>, boolean <span>originalvalue</span> } )<br>numeric <span>dwcontrol</span>.<span>GetItemNumber</span> ( long <span>row</span>, integer <span>column</span> <br> {, DWBuffer <span>dwbuffer</span>, boolean <span>originalvalue</span> } ) |
[Web DataWindow server component]
1 |
double <span>dwcontrol</span>.<span>GetItemNumber</span> ( long <span>row</span>, string <span>column</span> )<br>double <span>dwcontrol</span>.<span>GetItemNumberByColNum</span> ( long <span>row</span>, short <span>column</span> )<br>double <span>dwcontrol</span>.<span>GetItemNumberEx</span> ( long <span>row</span>, string <span>column</span>,<br> string<span>dwbuffer</span>, boolean <span>originalvalue</span> )<br>double <span>dwcontrol</span>.<span>GetItemNumberByColNumEx</span> ( long <span>row</span>, <br> short <span>column</span>, string <span>dwbuffer</span>, boolean <span>originalvalue</span> ) |
[Web ActiveX]
1 |
number <span>dwcontrol</span>.<span>GetItemNumber</span> ( number <span>row</span>, string <span>column</span>,<br> number <span>dwbuffer</span>, boolean <span>originalvalue</span> )<br>number <span>dwcontrol</span>.<span>GetItemNumber</span> (number <span>row</span>, number <span>column</span>,<br> number <span>dwbuffer</span>, boolean <span>originalvalue</span> ) |
Argument |
Description |
---|---|
dwcontrol |
A reference to a DataWindow control, |
row |
A value identifying the row location |
column |
The column location of the numeric data. To get the contents of a computed field, specify the name |
dwbuffer |
A value identifying the DataWindow buffer |
originalvalue (optional) |
A boolean indicating whether you want
If you specify dwbuffer, you must also |
Return Values
Returns the numeric value in the specified row and column
(decimal, double, integer, long, or real). Returns null if the column
value is null or if there is no DataWindow object assigned to the
DataWindow control or DataStore. Triggers the SystemError event
and returns –1 if any other error occurs (see “Handling errors”).
If any argument value is null, in PowerBuilder and JavaScript
the method returns null.
Usage
Use GetItemNumber to get information from
the DataWindow’s buffers. To find out what the user entered
in the current column before that data is accepted, use GetText.
In the ItemChanged or ItemError events, use the data argument.
To access a row in the original buffer, specify the buffer
that the row currently occupies (primary, delete, or filter) and
the number of the row in that buffer. When you specify true for originalvalue,
the method gets the original data for that row from the original
buffer.
Handling errors
The return value is a valid value from the database unless
the SystemError event is triggered. When the value cannot be converted
because the column’s datatype does not match the method’s datatype,
an execution error occurs, which triggers the SystemError event. The
default error processing halts the application. If you write a script
for the SystemError event, it should also halt the application.
Therefore, the error return value is seldom used.
Examples
These statements set EmpNbr to the current numeric
data in the primary buffer for row 4 of the column named emp_nbr
in dw_employee:
1 |
integer EmpNbr |
1 |
EmpNbr = dw_employee.<span>GetItemNumber</span>(4, "emp_nbr") |
These statements set EmpNbr to the current numeric
data in the filter buffer for row 4 of the column named salary of
dw_employee:
1 |
integer EmpNbr |
1 |
EmpNbr = dw_employee.<span>GetItemNumber</span>(4, & |
1 |
"salary", Filter!, false) |
These statements set EmpNbr to the original numeric
data in the primary buffer for row 4 of the column named salary
of dw_Employee:
1 |
integer EmpNbr |
1 |
EmpNbr = dw_Employee.<span>GetItemNumber</span>(4, & |
1 |
"salary", Primary!, true) |