CTRL+O
Lasttext
Displays the last text argument in the Text Argument dialog box. You can edit the text and then execute any PWB function that accepts a text argument, or you can cancel the dialog box.
If you edit the text and then cancel the dialog box, PWB retains the modified text. Thus, when you execute Lasttext again, the new text appears in the dialog box.
Arg [[Arg]]... [[Meta]] Lasttext (ALT+A [[ALT+A]]... [[F9]] CTRL+O)
Displays the last text argument in the Text Argument dialog box with the specified Arg count and Meta state.
Arg [[Arg]]... linearg | boxarg | streamarg [[Meta]] Lasttext (ALT+A [[ALT+A]]... linearg | boxarg | streamarg [[F9]] CTRL+O)
Displays the first line of the selection in the Text Argument dialog box with the specified Arg count and Meta state.
The return value of Lasttext cannot be tested.
The OpenInclude macro that follows opens an include file named in the next #include directive. The macro demonstrates a technique using the Lasttext function to pick up text from the file and modify it without modifying the file or the clipboard.
OpenInclude := \
Up Meta Begline Arg Arg "^[ \t]*#[ \t]*include" Psearch -> \
Arg Arg "[<>\"]" Psearch -> Right Savecur Psearch -> \
Selcur Lasttext Begline "$INCLUDE:" Openfile <n +> \
Lastselect Openfile <
In the fourth line, Lasttext pulls the selected filename into the Text Argument dialog box. The text argument is modified to prepend $INCLUDE: before passing it to the Openfile function.
In some macro-programming situations, you don't want to use the text immediately. Instead, you need to pick up some text, do some other processing, then use the text. In this situation, use the phrase:
(make selection) Lasttext Cancel ...
This picks up the text, then cancels the Text Argument dialog box. The selected text remains in the Lasttext buffer for later use. To reuse the text, call Lasttext again.
Arg, Lastselect, Meta, Prompt