Syntax 1: For text
Description
Retrieves or replaces the contents of the system clipboard with
text.
Syntax
|
1 |
Clipboard ( { string } ) |
|
Argument |
Description |
|---|---|
|
string (optional) |
A string whose value is the text you want to place in |
Return value
String.
Returns the current contents of the clipboard if the clipboard
contains text. If string is specified, Clipboard returns the current
contents and replaces it with string.
Returns the empty string (“”) if the clipboard is empty or it
contains nontext data, such as a bitmap. If string is specified, the
nontext data is replaced with string. If string is null, Clipboard
returns null.
Usage
You can use Syntax 1 with the Paste, Replace, or ReplaceText
function to insert the clipboard contents in an editable control or
StaticText control.
Calling Clipboard in a DataWIndow control or DataStore
object
To retrieve or replace the contents of the system clipboard with
text from a DataWindow item (cell value), you must first assign the
value to a string and then call the system Clipboard function as
follows:
|
1 2 |
string ls_data = dw_1.object.column_name[row_number] ::Clipboard(ls_data) |
The DataWindow version of Clipboard, documented in Syntax 2 (and
in the section called “Clipboard” in DataWindow Reference), is only applicable to graphs.
Examples
These statements put the contents of the clipboard in the variable
ls_CoName:
|
1 2 |
string ls_CoName ls_CoName = Clipboard() |
The following statements place the contents of the clipboard in
Heading, and then replace the contents of the clipboard with the string
Employee Data:
|
1 2 |
string Heading Heading = Clipboard("Employee Data") |
The following statement replaces the selected text in the
MultiLineEdit mle_terms with the contents of the clipboard:
|
1 |
mle_terms.ReplaceText(Clipboard()) |
The following statement exchanges the contents of the StaticText
st_welcome with the contents of the clipboard:
|
1 |
st_welcome.Text = Clipboard(st_welcome.Text) |
See also