_CLIPBOARD$

From QB64 Phoenix Edition Wiki
Revision as of 17:52, 25 May 2024 by RhoSigma (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The _CLIPBOARD$ statement copies the STRING value into the system clipboard.


Syntax

_CLIPBOARD$ = string_expression$


Description

  • string_expression$ is the string value to be sent to the clipboard.
  • The string value will replace everything previously in the clipboard.
  • Assemble long text into one string variable value before using this statement.
  • Add CHR$(13) + CHR$(10) CRLF characters to move to a new clipboard line.
  • When copying text files, end line CRLF characters 13 and 10 do not have to be added.
  • Numerical values can be converted to strings using STR$, _MK$, MKI$, MKL$, MKS$, MKD$, _BIN$, HEX$ or OCT$.
  • The clipboard can be used to copy, paste and communicate between running programs.


Examples

Example
Set 2 lines of text in the clipboard using a carriage return to end text lines
DIM CrLf AS STRING * 2 'define as 2 byte STRING
CrLf = CHR$(13) + CHR$(10) 'carriage return & line feed

_CLIPBOARD$ = "This is line 1" + CrLf + "This is line 2"
PRINT _CLIPBOARD$ 'display what is in the clipboard
This is line 1
This is line 2


See also



Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link