next up previous contents index
Next: A Macro Example Up: Appendix B: FIT2D Macro Previous: More Complicated Macros


``KEYBOARD'' Interface Commands for Macros

There are a number of ``KEYBOARD'' commands which are especially useful within macros to help make them versatile and easy to use. Here is list of the commands and their purpose:

CALCULATOR: The CALCULATOR menu can be used to preform mathematical operations or variable values, and set new variable values with the VARIABLE command.

CONCATENATION: Concatenate two input strings e.g. stored in two variables, and save in a named variable.

DEDUCE FILE SEQUENCE: Deduce components of file sequence and define standard internal variables with the components.

I2C: Convert integer to character representation, with control on the number of characters used

LIST VARIABLES: Outputs a table of currently defined variables and values. This is very useful for debugging a macro.

MESSAGE: Define text message for output to the user during a macro.

PAUSE: Wait for user return. This is a method of getting FIT2D to pause during a macro. (Useful for debugging and demostrations.)

QUESTION: Ask an interactive question during a macro. This is a very powerful command, and allows many different types of input to be defined, with default values, help text, and range checking.

SLEEP: Pause for a defined number of seconds. (Useful for slowing down FIT2D for demonstrations.)

VARIABLE: Define a variable and its corresponding value.

UN-DEFINE VARIABLE: Remove variable from the variable translation table.

WAIT: Wait for a user return (same as PAUSE).

Of course many other commands are also very useful, but these are the ones especially concerned with macros.

In addition to the main menu commands, a few very special instructions may be added to the macro, at any point:

DO: Start of a counted loop. See above for further information.

END DO: End of a counted loop.

%SLEEP: Special pause, which may be placed anywhere within the macro, unlike the SLEEP command which only works in the main menu of the ``KEYBOARD'' interface. The %SLEEP instruction is followed by the number of seconds to pause. e.g. %SLEEP 3 will pause for 3 seconds. A fraction of a second may be specified, but this will only work on certain versions of Unix.


next up previous contents index
Next: A Macro Example Up: Appendix B: FIT2D Macro Previous: More Complicated Macros
Andrew Hammersley
2004-01-09