14.3.3 Macro Arguments

If you enter an argument in PWB and then invoke a macro, the argument is passed to the first function in the macro that takes an argument:

tripleit:=copy paste paste

The tripleit macro invokes the copy and paste editing functions. When you highlight a text area and then invoke the macro, your highlighted argument is passed to the copy function, which copies the argument to the clipboard. The macro then invokes paste twice. The effect is to insert two copies of the highlighted text.

Summary: You cannot pass more than one argument from PWB to a macro.

You cannot pass more than one argument from PWB to a macro, even if the macro invokes more than one function that can accept an argument. The argument always goes to the first function in the macro that takes an argument.

You can also prompt for input inside a macro and pass the input as an argument using the prompt function as shown below:

newfile:=arg "Next file: " prompt setfile <

newfile:alt+n

The newfile macro prompts for a file name and then switches to the specified file. The sequence arg "Next file: " passes the text argument Next file: to prompt, which prints it in the text-argument dialog box and waits for the user to respond. The response is passed as a text argument to the setfile function, which switches to that file.