|
CLIPBOARDName:
READ STRING CLIPBOARD SET CLIPBOARD SKIP WRITE CLIPBOARD
CLIPBOARD RUN
CLIPBOARD CLEAR
CLIPBOARD LOOP
Potential uses for the clipboard include: SYSTEM CLIPBOARDOperating systems typically use the clipboard to implement cut and paste operations. These can sometimes be used with Dataplot.For example, to read data from the clipboard you can do something like the following
<perform system paste operation> END OF DATA Note that this works for Linux systems where Dataplot is built with the gfortran compiler. However, it does not work with the Windows version of Dataplot built with the current version of the Intel Fortran compiler (it did work with some earlier versions of the Intel compiler). Likewise, if you have Dataplot commands stored in the clipboard, then you can paste into the current Dataplot terminal window. Again this works under Linux systems. However it does not work under Windows with the Intel compiler. DATAPLOT CLIPBOARD COMMANDSAlthough system cut and paste operations can be adequate for many purposes, it can also be useful to have programatic access to the clipboard. For example, the system cut and paste does not work correctly for the Windows version of Dataplot. In addition, programatic access can be useful for communicating with non-Dataplot applications.The commands above can be divided into several categories:
This syntax is used to read numeric variables from the clipboard. Note that the clipboard should contain only numeric variables. If a non-numeric character is encountered, an error will be generated and the READ will not be performed. This capability is useful for accessing parts of a spreadsheet. For example, many spreadsheets will contain summary tables and graphs. Writing these types of spreadsheets to ASCII files tends to result in files that need substantial clean-up before they can be read by Dataplot. Alternatively, you can copy the relevant data from the spreadsheet to the clipboard and then use the READ CLIPBOARD command to read that data into Dataplot. Generally, this command works best when rectangular areas (i.e., the variables do not contain missing cells). Missing cells denoted by commas will be read correctly. However, spreadsheets will typically separate values with tabs rather than commas when copying to the clipboard. In this case, missing data will not be handled correctly. If you have spreadsheet columns of unequal length, you may need to copy and read the columns individually. The ROW LIMITS and SET READ FORMAT commands are not used when reading variables from the clipboard. By default the SKIP command is ignored. If you would like the SKIP command to be honored, enter the command
To revert to ignoring the SKIP command, enter the command
where <str1>, <str2>, ... <strk> is a list of strings to be read. This syntax is used to read strings into Dataplot from the clipboard. String one is read from the first line of the clipboard, string two is read from the second line of the clipboard, and so on. Individual strings are limited to a maximum of 255 characters. By default the SKIP command is ignored. If you would like the SKIP command to be honored, enter the command
To revert to ignoring the SKIP command, enter the command
where <st1>, <st2>, ... <stk> is a list of one or more strings and parameters to be written. This syntax is used to write strings and/or parameters to the clipboard. Dataplot will first print all specified strings. It will then print all specified parameters. Each string or parameter will be printed on a separate line. Parameters are printed using an E15.7 format. The total number of characters written to the clipboard is currently limited to 4096 characters. Dataplot will automatically add CR/LF to the end of each line written to the clipboard and an ending null byte. These Dataplot inserted characters count against the total character count. Note that this command will erase the current contents of the clipboard before writing the new strings and parameters. Writing strings and parameters cannot be mixed with writing variables to the clipboard. If the list of names includes both strings/parameters and variables, the variables will overwrite the strings and parameters.
where <st1>, <st2>, ... <stk> is a list of one or more variables. This syntax is used to write variables to the clipboard. Numeric values are written using an E15.7 format. The SET WRITE FORMAT and SET WRITE DECIMALS commands are ignored when writing to the clipboard. The total number of characters written to the clipboard is currently limited to 5000000 characters. Dataplot will automatically add CR/LF to the end of each line written to the clipboard and an ending null byte. These Dataplot inserted characters count against the total character count. Note that this command will erase the current contents of the clipboard before writing the new strings and parameters. Writing strings and parameters cannot be mixed with writing variables to the clipboard. If the list of names includes both strings/parameters and variables, the variables will overwrite the strings and parameters. Matrices are not currently written to the clipboard.
If this command is entered, the current contents of the clipboard will be deleted.
If this command is entered, the current contents of the clipboard will be listed to the screen. A maximum of 240 characters for a given line will be printed. The SET HELP LINES command can be used to specify how many lines are printed at once. Enter HELP HELP LINES for details. The default is 20 lines.
If this command is entered, the current contents of the clipboard will be copied to the the specified file. Individual lines will be truncated at 255 characters.
where <file> specifies the name of the file which will be copied to the clipboard. If this command is entered, the contents of the specified file will be copied to the clipboard. Individual lines will be truncated at 255 characters.
This command will return the number of lines in the clipboard. The result will be saved in the parameter PROBEVAL.
If this command is entered, Dataplot will execute each line in the clipboard as a Dataplot command. If this command is called from within a Dataplot macro (i.e., from a CALL <file> command), it will only be honored if the macro is a first level macro. That is, if you have nested CALL commands, CLIPBOARD RUN must be in the first macro called.
If Dataplot is executing commands from the clipboard, this command is used to revert reading commands from the terminal (or from a macro).
If a CLIPBOARD PAUSE command was entered from the clipboard to revert to reading commands from the terminal, then this command can be used to resume executing the commands in the clipboard.
If the CLIPBOARD LOOP command is entered, then the following algorithm is used:
This command is used to exit the CLIPBOARD LOOP command.
where <value> is a parameter or number. This command specifies the maximum number of iterations for the CLIPBOARD LOOP. That is, it specifies the maximum number of times the clipboard will be interogated. If this maximum is reached, the CLIPBOARD LOOP command will be ended (it can be explicitly ended with the CLIPBOARD LOOP END command).
where <value> is a number or parameter that specifies the delay. If a CLIPBOARD LOOP command was previously entered, this command specifies the length of the delay when interogating the clipboard. That is, if the clipboard is empty, wait the specified length of time before checking the clipboard again. The delay is specified in seconds.
where ON specifies that the clipboard will be cleared after a CLIPBOARD RUN command and OFF specifies that the clipboard will not be cleared after a CLIPBOARD RUN command. The default is OFF.
READ STRING CLIPBOARD STCLIP1
Extending this support to Unix/Linux and Mac OS X implementations is currently being investigated. 2020/06: Support has been extended to Unix/Linux platforms via the xclip program. The xclip program is an X11 based command line program for accessing either the clipboard, the primary selection or the secondary selection. To specify which of these is accessed when a CLIPBOARD command is entered, use the command
The default is CLIPBOARD and for Dataplot purposes this is what will typically be used. The CLIPBOARD commands work differently under Linux than under Windows. Under Windows, Dataplot uses library routines to access the clipboard directly. Under Linux, the xclip command is used to access the contents of the clipboard. Specifically (in the following, the "-selection clipboard" is replaced with "-selection primary" or "-selection secondary" depending on the value for the SET X11 SELECTION command)
The commands CLIPBOARD LOOP, CLIPBOARD PAUSE, CLIPBOARD RESUME and SET CLIPBOARD SKIP are not currently supported for Linux. The xclip command is not typically installed by default. However, package files are available for most common Linux installations. For example
If xclip is not available with your package manager, it can be built from source. The xclip program is lightweight, so the source build should be quick if you have the gcc compiler installed.
Extending Dataplot support for the clipboard to include binary data is not anticipated.
RUN CLIPBOARD is a synonym for CLIPBOARD RUN CLEAR CLIPBOARD is a synonym for CLIPBOARD CLEAR CLIPBOARD END LOOP is a synonym for CLIPBOARD LOOP END CLIPBOARD END OF LOOP is a synonym for CLIPBOARD LOOP END CALL CLIPBOARD is a synonym for CLIPBOARD RUN CB is a synonym for CLIPBOARD RUN
2019/03: Added SET CLIPBOARD RUN CLEAR 2019/03: Added CALL CLIPBOARD and CB as synonyms for CLIPBOARD RUN 2020/06: Added clipboard support for Linux via the xclip program COPY BERGER1.DAT CLIPBOARD SET CLIPBOARD SKIP ON SKIP 25 READ CLIPBOARD Y X BAT CLIPBOARD CLEAR
|
Privacy
Policy/Security Notice
NIST is an agency of the U.S.
Commerce Department.
Date created: 12/17/2014 |