5 Command Procedures

Commands can be input from macros (script or command files). This can be particularly useful if you frequently carry out a fixed sequence of operations. The command file can be in the directory from which you are running DIPSO, or in a default directory (OWNERDIR) of your own assignment. Thus if DIPSO is requested to execute a command file (without a full directory specification being given) it first looks in the current directory; if it doesn’t find it, it looks in a directory assigned the environment variable OWNERDIR; and if it still doesn’t find it, you get an error message. All your frequently used command files can therefore be kept in one place. For example, a file called TEST.CMD may contain the instructions:

  READ,DRED
  LOGY,YMULT -2.5,XMULT 1.0E-04,XINV
  PUSH,SL

The commands in this file would be executed by typing:

  @TEST

The unspecified mandatory parameters for READ and DRED would be prompted for, and input, at the terminal. The Y values in the ‘current’ array would be replaced by Log(10) Y (LOGY), then multiplied by -2.5 (YMULT -2.5); the X values would be multiplied by 104 (XMULT+1.0E-04), then replaced by 1/X values (XINV). The final data would then be PUSHed onto the stack, the contents of which would be displayed at the terminal (SL).

On completion of the commands in the file, control returns to the terminal.

On startup, DIPSO looks for a command file called startup.cmd in a directory which has been assigned the environment variable OWNERDIR. So, if you regularly want to change any default settings from those normally set, just create such a file, containing commands which will set your customised options (e.g. you may not like the standard X and Y labels, or you might want always to use native DIPSO data files rather than NDF data files, etc.).