Skip to content

clipboard_set_text

drewmccluskey edited this page Nov 28, 2018 · 1 revision

clipboard_set_text

Returns the current text from the clipboard.

Syntax:

clipboard_set_text(str);
Argument Description
str The text (as a string) to set the clipboard to hold.

Returns: N/A

Description

This function will set the clipboard to hold the defined string. You can set it to an empty string "" to effectively clear the clipboard of text.

NOTE: This function is only valid for the Windows target.

Example:

if clipboard_has_text()
   {
   str = clipboard_get_text();
   clipboard_set_text("");
   }

The above code checks the clipboard for text and if it contains any, it is read as a string into the variable "str". Finally, the clipboard is cleared by setting it to an empty string.

Back to strings

Clone this wiki locally