Executing Functions and Macros by Name

The most frequently used functions and macros are assigned to certain keys by default. For example, the Paste function is assigned to SHIFT+ENTER, Linsert is assigned to CTRL+N, and so on. Sometimes, however, you want to use a function or macro that is not assigned to a key. You can always assign a key by using the Key Assignments command or by using the Assign function. However, that is a lot of trouble for something you need only once. PWB allows you to execute a function or macro by name, rather than by pressing a key.

·To execute a function or macro by name:

Perform the function sequence Arg function Execute (ALT+A function F7).

In other words, press ALT+A (execute the Arg function), type the name of the function or macro, and then press F7 (invoke the Execute function).

The argument to Execute doesn't have to be a single function or macro name. It can be a list of functions and macros. The argument is really a temporary, nameless macro. This means that you can do anything in an argument to Execute that you can do in a macro. PWB follows the rules for macro syntax and execution. You can define labels, test function results, and loop.

Warning:

When executed from a macro, PWB functions that display a yes-or-no prompt assume a “Yes” response. To restore the prompt, use the macro prompt directive (<). For more information, see “Macro Prompt Directives” in PWB Help.