The .R command reads the contents of any item containing valid TCL statements, executes them in sequence, and places them on the stack. Typically the .R command retrieves items which were created using the .C command.
The .R command, unlike all other TCL Stacker commands, is a TCL-II command defined in the Master Dictionary.
Format
.R filename [item-ID] [(L)] |
If you don’t specify an item-ID, you are prompted for it. The L option loads the statements on the stack but does not execute them.
Each attribute in the specified item must contain a valid TCL command. Statement 1 is placed on the stack and executed, then the next statement is pushed on the stack and executed.
Because the .R command is stored in the Master Dictionary, it can be called from a Proc. (No other TCL stacker commands can be executed from a Proc.) However, only one .R command can be used in a Proc. Control will not return to the Proc after the .R command executes. For example, the following Proc might be named DO:
001 PQ 002 C DO ITEM-ID : RUN IDENTIFIED PROC FOUND IN TC FILE 003 H.R TC 004 A2 005 P |
The .R command itself is not stored on the stack when it is executed. You can, however, use .R in items that will be read and executed by the .R command. In other words, an .R command is completely recursive; it can execute items containing .R commands that, in turn, cause the statements in other items to be executed.
See Also
Executing Previous Statements (.X)
Replacing Text in the Stack (.M)
Storing a Series of Statements (.C)