Retrieves or replaces the contents of the system clipboard.
To |
Use |
---|---|
Retrieve or replace the contents of the system clipboard with text |
|
Replace the contents of the system clipboard with a bitmap image of a graph |
Retrieves or replaces the contents of the system clipboard with text.
Clipboard ( { string } )
Argument |
Description |
---|---|
string (optional) |
A string whose value is the text you want to place in the clipboard. The string replaces the current contents of the clipboard, if any. |
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.
You can use Syntax 1 with the Paste, Replace, or ReplaceText function to insert the clipboard contents in an editable control or StaticText control.
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:
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 DataWindow Reference), is only applicable to graphs.
These statements put the contents of the clipboard in the variable ls_CoName:
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:
string Heading
Heading = Clipboard("Employee Data")
The following statement replaces the selected text in the MultiLineEdit mle_terms with the contents of the clipboard:
mle_terms.ReplaceText(Clipboard())
The following statement exchanges the contents of the StaticText st_welcome with the contents of the clipboard:
st_welcome.Text = Clipboard(st_welcome.Text)
Replaces the contents of the system clipboard with a bitmap image of a graph. You can paste the image into other applications.
Graph objects in windows and user objects, and graphs in DataWindow controls and DataStore objects
name.Clipboard ( { graphobject } )
Argument |
Description |
---|---|
name |
The name of the graph or the DataWindow control or DataStore containing the graph you want to copy to the clipboard |
graphobject (DataWindow control and DataStore only) |
A string whose value is the name of the graph in the DataWindow object that you want to copy to the clipboard |
Integer. Returns 1 if it succeeds and -1 if an error occurs. If any argument’s value is null, Clipboard returns null.
This statement copies the graph gr_products_data to the clipboard:
gr_products_data.Clipboard()
This statement copies the graph gr_employees in the DataWindow control dw_emp_data to the clipboard:
dw_emp_data.Clipboard("gr_employees")