Reviewed and revised April 2024
xcall MIAMEX, MX_CLIPBOARD, opcode, text {,status {,srow, scol, erow, ecol}}
MX_CLIPBOARD (MIAMEX 105) allows you to retrieve or set the text contents of the clipboard.
This function has both a subroutine and a print tab implementation.
Parameters
opcode (Num) [in]
Value |
Description |
---|---|
0 (MXOP_GET) |
Retrieve clipboard text contents |
1 (MXOP_SET) |
Set clipboard text either from screen coordinates (if non-zero) or from text parameter |
2 |
Same as 0 but applies to ATE client |
3 |
Same as 1 but applies to ATE client |
5 |
Mark area specified by coordinates |
Note that in non-ATE A-Shell/Unix environments, opcode 0 (MXOP_GET) and 1 (MXOP_sET) will simulate clipboard operations by reading/writing to a file MEM0:<job>.CLP[1,1] if the file exists. If it does not exist, status will be set to -1, the same as if the Windows clipboard could not be opened.
text (String) [in/out]
will receive the clipboard text contents for opcode 0 and 2. For opcode 1 and 3, if you want to specify a string containing the text to copy to the clipboard, then put it in the text parameter and do not specify the srow, scol, erow, and ecol parameters (or set them to 0). Otherwise, if you want to copy a rectangular area of the current screen to the clipboard, then specify the coordinates in the last four parameters, in which case text will be ignored. The maximum effective size for text is about 3K.
status (Signed Int) [out]
Value |
Description |
---|---|
0 |
Success |
-1 |
Unable to open clipboard; locked? |
-2 |
Clipboard can be opened but not read, or there is no text available in the clipboard |
-3 |
Unable to lock memory |
-4 |
Invalid coordinates |
-99 |
Failure communicating with ATE client |
srow,scol,erow,ecol (Num) [in]
Optional coordinates used with opcodes 1, 3 to specify the screen area to be copied to the clipboard. (Set them all to 0 in order to load the clipboard from the text parameter instead of the screen.) For opcode 5, they specify the screen area to be marked. Ignored for all other opcodes.
Comments
Other than the non-GUI A-Shell/Unix case just mentioned, you can safely used opcodes 2 and 3 in place of 0 and 1 (i.e. add +2) without regard to whether the configuration involves ATE or some other Windows architecture (standalone, peer-to-peer, Terminal Server, etc.).
In the Windows environment, MX_CLIPBOARD internally uses the AG_CLIPBOARD implementation.
See Also