Welcome | spec | C-PLOT | Support | Downloads | Users | Contact
Contents -> REFERENCE MANUAL -> Syntax Description -> Cleanup Macros
spec Manual


2.3.11. - Cleanup Macros



On keyboard interrupts (and command and syntax errors), if macros named cleanup or cleanup1 have been defined, their definitions are read as input. Typical uses of the cleanup macro are to return motors to starting positions and/or to insert comments in data files after aborted scans. After running the cleanup and/or cleanup1 macros, spec gives the standard prompt and waits for the next command from the keyboard. If there is another ^C interrupt or error while the commands contained in the cleanup or cleanup1 macros are being executed, the macro definitions are removed.

As of release 4.03.13, the additional cleanup_once and cleanup_always macro names are recognized. Each, if defined, will be pushed on to the input stream on ^C interrupts and command and syntax errors, as above. The cleanup_once definition, though, is always removed before the next main prompt is issued. On the other hand, the cleanup_always definition will never be automatically removed. Definitions for these macros should be constructed using the cdef() (chained macro) function (described 2.4.4.1 ) in order to allow various clean-up actions to be added and removed during the flow of arbitrary statement blocks.


  Top
  Prev | Next