getClipboardText()

Returns the clipboard text as plain text, or an empty string if the clipboard does not contain any text.

Synopsis

string getClipboardText();

Parameters

Parameter Description
- -

Return value

The clipboard text or an empty string if the clipboard does not contain any text.

Description

The function returns the clipboard text as plain text, or an empty string if the clipboard does not contain any text (= CTRL+V). The text can be passed to the clipboard via CTRL+C (copy), CTRL+X (cut) or setClipboardText().

Example

When clicking on a button in a plant panel the value from the clipboard should be shown in a text field (TEXTFIELD1).

The Clicked() event of the button contains the following code:

main()
{
  string clipboardText;
  clipboardText = getClipboardText();
  TEXTFIELD1.text(clipboard);
}

A given text, e.g. "Hello world" has been copied from an external file to the clipboard using CTRL+C.

Now, if the button in the plant panel is clicked, the text from the clipboard ("Hello world") is written to the text field.

Assignment

Miscellaneous functions

Availability

UI