GetItemDecimal method (DataWindows)
Description
Gets data whose type is decimal 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.
Controls
DataWindow type |
Method applies to |
---|---|
PowerBuilder |
DataWindow control, DataWindowChild object, DataStore |
Syntax
[PowerBuilder]
1 |
decimal <span>dwcontrol</span>.<span>GetItemDecimal</span> ( long <span>row</span>, integer <span>column</span> <br> {, DWBuffer <span>dwbuffer</span>, boolean <span>originalvalue</span> } ) |
1 |
decimal <span>dwcontrol</span>.<span>GetItemDecimal</span> ( long <span>row</span>, string <span>column</span> <br> {, DWBuffer <span>dwbuffer</span>, boolean <span>originalvalue</span> } ) |
Argument |
Description |
---|---|
dwcontrol |
A reference to a DataWindow control or |
row |
A value identifying the row location |
column |
The column location of the data. The To get the contents of a computed field, specify the name |
dwbuffer (optional) |
A value of the dwBuffer enumerated datatype |
originalvalue (optional) |
A boolean indicating whether you want
If you specify dwbuffer, you must also |
Return Values
Returns the decimal value in the specified row and column.
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, the method returns null.
Usage
Use GetItemDecimal when you want 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 salary_amt to the current
decimal data in the primary buffer for row 4 of the column named
emp_salary of dw_employee:
1 |
decimal salary_amt |
1 |
salary_amt = & |
1 |
dw_employee.<span>GetItemDecimal</span>(4, "emp_salary") |
These statements set salary_amt to the current
decimal data in the filter buffer for row 4 of the column named
emp_salary of dw_employee:
1 |
decimal salary_amt |
1 |
salary_amt = dw_employee.<span>GetItemDecimal</span>(4, & |
1 |
"emp_salary", Filter!, false) |
These statements set salary_amt to the original
decimal data in the primary buffer for row 4 of the column named
emp_salary of dw_employee:
1 |
decimal salary_amt |
1 |
salary_amt = dw_employee.<span>GetItemDecimal</span>(4, & |
1 |
"emp_salary", Primary!, true) |