Cut

Description

Deletes selected text from the specified control and stores it on the clipboard, replacing the clipboard contents with the deleted text or object.

Applies to

DataWindow, MultiLineEdit, SingleLineEdit, DropDownListBox, DropDownPictureListBox, and OLE controls

Syntax

controlname.Cut ( )

Argument

Description

controlname

The name of the control containing the text or object to be cut.

If controlname is a DataWindow, text is cut from the edit control over the current row and column. If controlname is a DropDownListBox, the AllowEdit property must be true.

Returns

Long.

For editable controls, Cut returns the number of characters that were cut from controlname 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 controlname is null, Cut 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 insert the contents of the clipboard into a control, use the Paste function.

To delete selected text or an OLE object but not store it in the clipboard, use the Clear function.

Examples

Example 1

Assuming the selected text in mle_emp_address is Temporary, this statement deletes Temporary from mle_emp_address, stores it in the clipboard, and returns 9:

mle_emp_address.Cut()

See also