To define a new macro (user function), do the following:
The name of a macro must be a single identifier not coinciding with built-in functions, constants and previously defined macros. If it coincides with the name of an already defined macro, the definition of the latter is replaced by the new one after confirmation by the user. The length of a macro's name is limited to 5 characters (to fit the space on the button faces).
The definition of a macro must be a valid expression. In the expression, built-in functions, constants and previously defined macros can be used. Any unknown identifiers are considered as macro's parameters. There must be at least one parameter in every macro (if one needs to define a new constant expression, e.g. p2, use something like 0*x+PI^2 as the definition).
In the macro recording mode, macro definition can be edited. To do it, enter the macro name in the name field and enter the new definition. Also, when the macro mode is started, the list of all macros and definitions is displayed in the parameter list. Double-clicking on a line in the list causes the name and the definition of a particular macro to appear in the corresponding fields. Redefining a macro with an empty definition causes its removal from the system. All the macros whose definition contains the removed macro are removed as well. For instance, if macro F is defined as x^2 + 2*x*y + y^2 and macro G is defined as F(sin(x), cos(x)), and macro H is defined as G (x/PI), then the removal of the macro F from the system will cause the removal of the macros G and H which depend on F. The user will be asked whether he indeed wants to remove a macro.
To export current macros to a file, select Export macros from the File menu. You will be prompted for a file name. The currently active set of macros will be saved in the chosen file. The default extension for macro files is .mac. Macros can be imported from macro files. To import macros from a file, select Import macros in the File menu and choose the desired file name. The current set of macros will be removed from the system and replaced by the macros from the chosen file. The name of the current macro file (if any) is displayed in the title of Math•Mate's main window.