Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Syntax 1: For selected text – PB Docs 2021 – PowerBuilder Library

Syntax 1: For selected text – PB Docs 2021

Syntax 1: For selected text

Description

Deletes selected text or an OLE object from the specified control,
but does not store it in the clipboard.

Applies to

DataWindow, EditMask, InkEdit, MultiLineEdit, SingleLineEdit,
RichTextEdit, DropDownListBox, DropDownPictureListBox, OLE controls, and
OLEStorage objects

Syntax

Argument

Description

objectname

One of the following:

  • The name of the DataWindow control, EditMask,
    MultiLineEdit, SingleLineEdit, RichTextEdit,
    DropDownListBox or DropDownPictureListBox from which you
    want to delete (clear) selected text.

  • The name of an OLE control or storage object
    variable (type OLEStorage) from which you want to release
    its OLE object.

If objectname is a DropDownListBox or
DropDownPictureListBox, its AllowEdit property must be
true.

Return value

Integer for DataWindow, InkEdit, and list boxes, Long for other
controls.

For edit controls, returns the number of characters that Clear
removed from objectname. If no text is selected, no characters are
removed and Clear returns 0. If an error occurs, Clear returns
-1.

For OLE controls and storage variables, returns 0 if it succeeds
and -9 if an error occurs.

If objectname is null, Clear returns null.

Usage

To select text for deleting, the user can use the mouse or
keyboard. You can also call the SelectText function in a script.

To delete selected text and store it in the clipboard, use the Cut
function.

Clearing the OLE object from an OLE control deletes all references
to it. Any changes to the object are not saved in its storage object or
file.

Clearing an OLEStorage object variable breaks any connections
established by Open or SaveAs between it and a storage file (when Open
or SaveAs is called for the OLEStorage object variable). It also breaks
connections between it and any OLE controls that have called Open or
SaveAs to connect to the object in the storage variable.

Examples

If the text in sle_comment1 is Draft and it is selected, this
statement clears Draft from sle_comment1 and returns 5:

If the text in sle_comment1 is Draft, the first statement selects
the D and the second clears D from sle_comment1 and returns 1:

This example clears the object associated with the OLE control
ole_1, leaving the control empty:

This example clears the object in the OLEStorage object variable
olest_stuff. It also leaves any OLE controls that have opened the object
in olest_stuff empty:

See also

ClearAll

Close

Cut

Paste

ReplaceText

SelectText


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x