|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Clipboard Commands > Clipboard Commands |
MiniRobotLanguage (MRL)
CLP. Command
Clipboard Operation
Intention
Return or set the Value of the System Clipboard(s).
This is an older Command that still works but has mostly been replaced with the newer CLB.-Command Series.
Modes of operation:
' General Format:
CLP.proto|$$MAIN[|$$CPT]
' put Clipboard -> TOS
CLP. (no parameter)
' Clipboard Clear
CLP.c
' write Text to Clipboard
CLP.$$TXT
' read Text/Variable from Clipboard
CLP.r|$$RET|$$CPT
' write Variable-Content to Clipboard
CLP.t|$$TXT|$$CPT
' wait for Clipboard-Change
CLP.w|$$TXT|$$CPT
Syntax
CLP.P1|P2[|P3]
Parameter Explanation
P1 - Type of Operation
Please specify only one prototype-letter for this command. Successive letters will be ignored.
c - Clear the Clipboard.
t - write Text to clipboard
r - read from Clipboard
P2 - VAR with string or for result
P3 - optional: Clipboard Type to use.
w - wait for Clipboard change.
P1 is maximum waiting-time in seconds or zero for endless.
P2 gets the new value from the clipboard.
The result can be in the original Variable P1 or if P3 is given, it will be placed in P3.
The following Clipboard-Types can be used as third parameters for "r" and "t" (use the number!. If you are not sure for what you need this parameter, don't use it. Default value if omitted is 7.
TEXT = 1
BITMAP = 2
METAFILEPICT = 3
SYLK = 4
DIF = 5
TIFF = 6
OEMTEXT = 7
DIB = 8
PALETTE = 9
PENDATA = 10
RIFF = 11
WAVE = 12
UNICODETEXT = 13
ENHMETAFILE = 14
HDROP = 15
LOCALE = 16
DIBV5 = 17
MAX = 18 ' varies by Windows version
Speed in Ticks:
This command uses typically around 1000 to 7000 Ticks heavily depending on Parameters.
Example
'***********************************
' CLP.-Sample 1
'***********************************
' Screenshot the desktop into Clipboard.
'***********************************
' CLP.-Sample 2
'***********************************
' Remove a picture from Clipboard
CLP.c||2
ENR.
'***********************************
' CLP.-DEMO
'***********************************
: §§TXT=http://www.it-berater.org
' When using no parameter, CLP. returns the Text-Clipboard-Content on Stack
CLP.
PRT.Stack-Content:>$$000<
PRT.---------------------------
' When using one parameter, CLP. writes the String into the Text-Clipboard
CLP.§§TXT
CLP.r|§§OUT
PRT.Clipboard: >§§OUT<
PRT.---------------------------
' Now we clear the Clipboard and use the systemvariable for Clipboard
CLP.§§TXT
CLP.c
CLP.r|§§OUT
PRT.Clipboard: >$cpb$<>§§OUT<
PRT.---------------------------
' Starting Parallel-Robot that will change the clipboard
PRR.
PAU.5
CLP.t|Hallo!
PAU.5
CLP.t|Hey man!
ENR.
PRE.
PRT. Waiting for Change!
CLP.§§TXT
CLP.w
PRT. Clipboard is: >$cpb$<
PRT.---------------------------
PRT. Now waiting for change with timeout 50 Seconds
: §§TRIM=5
CLP.w|§§TIM|§§CIP
' The Changeflag is 0 if a timeout has occured and 1 if the clipboard has changed in time
PRT.Clipboard Change to >§§CIP< Changeflag was: §§TIM
DMP.4
MBX.Ready
END.
Speed in Ticks:
This command uses typically around 7000 Ticks heavily depending on Parameters.
Remarks
-
Limitations:
Use the ANA.ToClipboard-Command to place Pictures in the Clipboard.
To Read Pictures from the Clipboard, use the ANA.FromClipboard-Command.
See also: