Copy

Description

Puts selected text or an OLE object on the clipboard. Copy does not change the source text or object.

Applies to

DataWindow, MultiLineEdit, SingleLineEdit, RichTextEdit, DropDownListBox, DropDownPictureListBox, OLE controls, and OLE DWObjects (objects within a DataWindow object that is within a DataWindow control)

Syntax

objectref.Copy ( )

Argument

Description

objectref

One of the following:

  • The name of the control containing the text you want to copy to the clipboard.

  • The name of the OLE control or the fully qualified name of a OLE DWObject within a DataWindow control that contains the object you want to copy to the clipboard.

The fully qualified name for a DWObject has this syntax:

dwcontrol.Object.dwobjectname 

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

Returns

Integer

For edit controls, Copy returns the number of characters that were copied to the clipboard. If no text is selected in objectref, no characters are copied and Copy returns 0. If an error occurs, Copy returns -1. If objectref is null, Copy returns null.

Usage

To select text for copying, 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.

Copy does not delete the selected text or OLE object. To delete the data, use the Clear or Cut function.

Examples

Example 1

Assuming the selected text in mle_emp_address is Temporary Address, these statements copy Temporary Address from mle_emp_address to the clipboard and store 17 in copy_amt:

integer copy_amt

copy_amt = mle_emp_address.Copy()

See also