Cut

Description

Deletes selected text in the current row and column of an edit control and stores it on the clipboard, replacing the clipboard contents with the deleted text.

Applies to

DataWindow type

Method applies to

PowerBuilder

DataWindow control

Web ActiveX

DataWindow control

Syntax

PowerBuilder

long dwcontrol.Cut ( ) 

Web ActiveX

number dwcontrol.Cut ( )

Argument

Description

dwcontrol

A reference to a DataWindow control. The text is cut from the edit control over the current row and column.

Returns

Returns the number of characters that were cut from dwcontrol and stored in the clipboard. If no text is selected, no characters are cut and Cut returns 0. If an error occurs, Cut returns –1.

If dwcontrol is null, the method returns null.

Usage

To select text for deleting, the user can use the mouse or keyboard. You can also call the SelectText method in a script. For the RichTextEdit presentation style in PowerBuilder, there are several additional methods for selecting text: SelectTextAll, SelectTextLine, and SelectTextWord.

To insert the contents of the clipboard into a control, use the Paste method.

To delete selected text but not store it in the clipboard, use the Clear method.

NotePowerBuilder environment For use with other PowerBuilder controls, see Cut in the PowerScript Reference.

Examples

Example 1

Assuming the selected text in the edit control of dw_emp is Temporary, this statement deletes Temporary from the edit control, stores it in the clipboard, and returns 9:

dw_emp.Cut()

See also