next up gif contents index
Next: Graphics Up: Menus Previous: Picking

 

Macros

      This menu provides quick access to spock's macro facility. Macros are user-defined procedures that may be used to simplify a complex or repetitive task. Macros are stored in the file ./.spmacros which is erased each time spock is run. The file is not deleted on exit from spock so that it can be inspected and macros taken from it and added to the user .spockrc file or other files if desired. Macros are similar to history or command files §7 with several important additions. Macros will prompt for missing values, pop-up menu items, etc. Here's a simple example macro definition as recorded in an interactive session (this example assumes users are familiar with history/command files, §7):
MAC>  Delete_Mol
TEXT> menu
MENU> Modeling
MENU> Delete Atoms
MENU> Molecule
MENU> Mol 1: (ALA    1   C   - ALA    1   WAT)
ENDM> Delete_Mol
This defines a macro Delete_Mol which will delete molecule 1 if molecule 1 happens to consists of atoms named ALA 1 C-ALA 1 WAT. As this is clearly not a general case it might be nice to generalize this macro. Simply deleting the Mol 1: ... line will do the trick. When spock executes the macro it expects to find a MENU> line at that point. Since it does not, spock will temporarily switch back to interactive mode and display a pop-up menu with whatever molecules are defined when the macro is run. This quite different from a command file, which would simply signal an error and try to continue.   Macros may be defined from history or command files. The default macros are defined in the system configuration file $SPOCK/Spockrc3.8). Macros may also be defined on-the-fly by choosing ``Record Macro'' from the macro menu. Spock will prompt for a name for the macro. All actions after this point are added to the macro until ``End Macro'' is selected from the macro menu. The command-line interface to macro creation and execution is described in § 5.2.7. The rest of the macro menu simply consists of macro names. Selecting a macro name will, of course, execute that macro.  

Default macros

The following macros are defined by default in $SPOCK/Spockrc:

 

Macro packages

  Spock is supplied with an ``effects'' macro package which may be useful in making movies. This package automates such tasks as fade-ins and fade-outs, etc. To use these macros, you must load the history file $SPOCK/lib/effects.sp.

Other macro packages may be included in future releases. Users are invited to submit macro pacakges for inclusion in the spock distribution.  


next up gif contents index
Next: Graphics Up: Menus Previous: Picking

Jon Christopher
Tue Sep 14 16:44:48 CDT 1999