PLT Command Files


Next: Version Control Up: Miscellaneous Previous: Miscellaneous

PLT Command Files

PLT commands can also be entered via a command file. For example, if you often enter the sequence of commands FOnt Roman followed by CSize 1.3, then you could create a file called NICE.PCO that contains the lines

FOnt Roman
CSize 1.3
To execute these commands inside PLT, all you need to type is
PLT> @NICE
(A default file extension .PCO is assumed.) Thus command files provide a way to enter several and/or complicated commands easily.

Note that the reference to a command file is a legal PLT command that can appear in a QDP file. Since this is a PLT command, QDP itself will not open and read the command file. Hence, QDP commands and data lines cannot be entered via a command file. Command files serve two important uses in QDP files. First, they provide a way to enter the same set of commands to several files. Second, for long data files, editing the QDP file can be tedious. Hence, you can edit it once to enter a reference to the command file. Thereafter, whenever you want to change the PLT command list, you only need to edit the command file.

PLT searches up to three different directories for the specified indirect command. The current directory is always searched first. If the file is not found in the current directory then PLT tries to translate the logical name (under VMS) or environment variable (under UNIX or DOS) called MY_XCOMS. If MY_XCOMS has been defined, then PLT searches the specified directory. If the file still has not been found then PLT searches the XANADU:[LIB.XCOMS] directory. This three level search allows you to create system-wide files, user-wide files, and directory specific files. For example, many locations create a file HARD.PCO in the XANADU:[LIB.XCOMS] directory that (1) creates a hardcopy file and (2) spools the file to the printer (done using the $ command to spawn a job to spool the plot to the printer). This then allows all users on that system to use

PLT> @HARD
to immediately print a hardcopy. If you do not like something about the existing @HARD command then you can easily create a new private version of this command. First copy the file to one of your own directories, modify the file, and define MY_XCOMS to contain the name of the directory containing the new version. Once this has been done, PLT will find and run your version of the command instead of the system installed version.

It is possible to use parameters with indirect command files. The parameter values are entered on the same line that opened the indirect command file. Thus,

PLT> @test one two three
would cause plt to open and read the TEST.PCO file with three parameters ``one'', ``two'', and ``three''. If n is a number then the sequence %n% will be replaced with the nth parameter. For the above example, %1% will be replaced with `one', %2% with `two', etc. The following illustrates a possible indirect file that could use up to three parameters:
LABel X %1%
LABel Y %2%
LABel T %3%
If you fail to enter all three parameters, then %n% will be replaced with a null string for the unentered parameters.

It is possible for one indirect file to call another indirect file and pass in parameters. Thus,

@deeper first %2% %3%
is a valid line in an indirect command file. In this example, the first parameter is ``first'', whereas the next two parameters will be set equal to parameters 2 and 3 of the current script. Also quotes can be used to denotes a single parameter with embedded spaces, or other `magic' characters. Thus the line,
@file "This is all one" two three
contains three parameters, and the first parameter is the string `This is all one'.



next up previous contents
Next: Version Control Up: Miscellaneous Previous: Miscellaneous



Web Page Maintained by: Dr. Lawrence E. Brown elwin@redshift.gsfc.nasa.gov