Skip to content

SetClipboardData

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

SetClipboardData BlitzLLVM

SetClipboardData:Int32 text:String
Parameter Mode Type Default Description
text In String required The text to put on the clipboard.

Returns: 1 if the text is on the clipboard, 0 if the window system refused it.

Description

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

Puts a text on the clipboard of the system, where other programs can paste it, and replaces what was 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. A number is turned into its text first, like Print does.
  • An empty text empties the clipboard.
  • Line ends are kept as they are. Other programs usually expect 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, the text is only kept inside the program, where GetClipboardData still finds it.
  • Programs written for the originals that declare SetClipboardData%(format%, txt$) of user32.dll themselves keep working on every system: the command takes the place of the library, and the format number in front of the text is ignored. The same goes for OpenClipboard, CloseClipboard, EmptyClipboard and ExamineClipboard, which are only there for such programs and are not needed with this command.

Examples

SetClipboardData "Hello from BlitzLLVM"
Print GetClipboardData()
Hello from BlitzLLVM

Related Commands

GetClipboardData BlitzLLVM

Home · Command Index


Getting started

Language

Tools


Language Features
BlitzBasic
Blitz3D
BlitzPlus
Differences

More

Clone this wiki locally