Skip to content

GetClipboardData

Narta Xaymar Dirks edited this page Nov 30, 2026 · 1 revision

GetClipboardData BlitzLLVM

GetClipboardData:String

Returns: The text on the clipboard, or an empty text if there is none.

Description

BlitzLLVM This command does not exist in the original Blitz products. BlitzLLVM adds it.

The text on the clipboard of the system, which the program or another program put there. This is a BlitzLLVM extension: the originals have no clipboard commands, so programs for them declared the ones of user32.dll in a .decls file, which only worked on Windows.

  • The clipboard only holds text. When it holds something else, such as a picture, the result is an empty text.
  • Line ends come back as the other program wrote them: usually Chr(13) + Chr(10) on Windows and Chr(10) elsewhere.
  • The clipboard belongs to the window system, so it is shared with other programs once the program has a window (the one of Graphics, or a BlitzPlus window). Before that, and with BLITZLLVM_HEADLESS=1, it only holds what the program put there with SetClipboardData.
  • Programs written for the originals that declare GetClipboardData$(format%) of user32.dll themselves keep working on every system: the command takes the place of the library, and the format number is ignored.

Examples

SetClipboardData "Copied"
text$ = GetClipboardData()
Print "Pasted: " + text$
Pasted: Copied

Related Commands

SetClipboardData BlitzLLVM

Home · Command Index


Getting started

Language

Tools


Language Features
BlitzBasic
Blitz3D
BlitzPlus
Differences

More

Clone this wiki locally