Clear method (DataWindows)
Description
Deletes selected text in the edit control over the current
row and column, but does not store it in the clipboard.
Controls
DataWindow type |
Method applies to |
---|---|
PowerBuilder |
DataWindow control |
Web ActiveX |
DataWindow control |
Syntax
[PowerBuilder]
1 |
long <span>dwcontrol</span>.<span>Clear</span> ( ) |
[Web ActiveX]
1 |
number <span>dwcontrol</span>.<span>Clear</span> ( ) |
Argument |
Description |
---|---|
dwcontrol |
A reference to a DataWindow control |
Return Values
Returns the number of characters that Clear removed
from dwcontrol. If no text is selected, no
characters are removed and Clear returns 0. If
an error occurs, Clear returns –1.
Usage
To select text for deleting, the user can use the mouse or
keyboard. You can also call the SelectText method
in a script.
To delete selected text and store it in the clipboard, use
the Cut method.
For use with other PowerBuilder controls, see Clear in
the PowerScript Reference.
Examples
If the user is editing the emp_name column
in dw_emp and selects the text Wilson, this statement clears
Wilson from the edit control and returns 6:
1 |
long chars_returned |
1 |
chars_returned = dw_emp.<span>Clear</span>( ) |
If the text in the edit control in dw_emp
is Wilson, the first statement selects the W and the second clears
W from the edit control. The return value would be 1:
1 |
dw_emp.SelectText(1,1) |
1 |
dw_emp.<span>Clear</span>( ) |
See Also
-
Clear in the PowerScript
Reference