GetItemString method (DataWindows)
Description
Gets data whose type is String 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, GetItemStringEx, GetItemStringByColNumEx,
and GetItemStringByColNum, 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 |
string <span>dwcontrol</span>.<span>GetItemString</span> ( long <span>row</span>, integer <span>column</span> <br> {, DWBuffer <span>dwbuffer</span>, boolean <span>originalvalue</span> } )<br>string <span>dwcontrol</span>.<span>GetItemString</span> ( long <span>row</span>, string <span>column</span> <br> {, DWBuffer <span>dwbuffer</span>, boolean <span>originalvalue</span> } ) |
[Web DataWindow server component]
1 |
string <span>dwcontrol</span>.<span>GetItemString</span> ( long <span>row</span>, string <span>column</span> )<br>string <span>dwcontrol</span>.<span>GetItemStringByColNum</span> ( long <span>row</span>, short <span>column</span> )<br>string <span>dwcontrol</span>.<span>GetItemStringByColNumEx</span> ( long <span>row</span>, short <span>column</span>,<br> string <span>dwbuffer</span>, boolean <span>originalvalue</span> )<br>string <span>dwcontrol</span>.<span>GetItemStringEx</span> ( long <span>row</span>, string <span>column</span>, <br> string <span>dwbuffer</span>, boolean <span>originalvalue</span> ) |
[Web ActiveX]
1 |
string <span>dwcontrol</span>.<span>GetItemString</span> (number <span>row</span>, number <span>column</span>, <br> number <span>dwbuffer</span>, boolean <span>originalvalue</span> )<br>string <span>dwcontrol</span>.<span>GetItemString</span> ( number <span>row</span>, string <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 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 string value in the specified row and column.
Returns the empty string (” “) if there is no
DataWindow object assigned to the DataWindow control or DataStore
or if any other error occurs.
If any argument value is null, in PowerBuilder the method
returns null.
Usage
Use GetItemString 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.
GetItemString returns a formatted value
in the case of a computed column, and an unformatted value in the
case of a noncomputed column. For PowerBuilder DataWindows, you
can use the GetItemFormattedString method to
return a formatted value, or the GetItemUnformattedString method
to return an unformatted value, for any type of column.
An execution error occurs when the datatype of the DataWindow
column does not match the datatype of the method—in this
case, String.
Examples
These statements set LName to the current string
in the primary buffer for row 3 of the column named emp_name
in the DataWindow dw_employee:
1 |
String LName |
1 |
LName = dw_employee.<span>GetItemString</span>(3, "emp_name") |
These statements set LName to the current string
in the delete buffer for row 3 of the column named emp_name
of dw_employee:
1 |
String LName |
1 |
LName = dw_employee.<span>GetItemString</span>(3, & |
1 |
"emp_name", Delete!, false) |
The following statements set LName to the original
string in the delete buffer for row 3 of the column named emp_name
of dw_employee:
1 |
String LName |
1 |
LName = dw_employee.<span>GetItemString</span>(3, & |
1 |
"emp_name", Delete!, true) |