1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-20 22:05:15 +00:00
qb64/internal/help/_CLIPBOARD$.txt
Luke Ceddia b586eafd3b Integrated _BLINEINPUT into regular LINE INPUT for BINARY files
LINE INPUT will now use the faster method if passed a file handle
that has been opened FOR BINARY. As such, the _BLINEINPUT command
has been removed.

qb64.bas now takes advantage of this for reading from '$include files,
at least in Include Manager 1. Some tweaking of internal/source/main.txt
was required to get things into a sane state, so I'm holing off changing
the compiler any further so the auto-builder can make sure everything's
smoothed over.

Note: Everything should still compile as normal; I'm just being overcautious.
2014-07-27 00:06:17 +10:00

51 lines
1.7 KiB
Plaintext

The {{KW|_CLIPBOARD$}} function returns the current Operating System's clipboard contents as a [[STRING]].
{{PageSyntax}}
:''result$'' = {{KW|_CLIPBOARD$}}
{{PageDescription}}
* Text returned can contain the entire contents of a copied file or web page.
* The string returned can also contain formatting like CRLF ([[CHR$]](13) + [[CHR$]](10)) end of line characters.
* The clipboard can be used to copy, paste and communicate between running programs.
''Example:'' Passing a string value between two running programs no matter where they are located.
Program1:
{{CodeStart}} '' ''
{{Cl|PRINT}} "Start Program2 to read your text entries! Empty entry quits!"
{{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "Entry program started!" 'set clipboard initially
DO
{{Cl|LINE INPUT}} "Enter some text to send to other program: ", text$
{{Cl|IF...THEN|IF}} text$ = "" {{Cl|THEN}} {{Cl|EXIT DO}}
{{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = text$
{{Cl|LOOP}}
{{Cl|SYSTEM}} '' ''
{{CodeEnd}}
Program2:
{{CodeStart}}
{{Cl|PRINT}} "Enter text in Program1 and this program will read it. Esc key quits!"
DO
text$ = {{Cl|_CLIPBOARD$}} 'function returns clipboard contents
{{Cl|IF...THEN|IF}} {{Cl|LEN}}(text$) {{Cl|THEN}}
{{Cl|PRINT}} text$
{{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "" 'clear clipboard after a read
{{Cl|END IF}}
{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27)
{{Cl|END}} '' ''
{{CodeEnd}}
:''Explanation:'' Compile and run both programs at once to see the interaction. You could also run them on different paths.
{{PageSeeAlso}}
* [[_CLIPBOARD$ (statement)]]
{{PageNavigation}}