.R Command

Executes stack statements stored in a file item. The .R (run) command is used in conjunction with the .C command to save frequently performed command procedures and recall them for execution. The .R command executes one or more stack statements that have been stored in a file item with the .C command. You can also load these statements into the stack and then selectively execute them.

Format

.R [DICT] filename item-ID [(L)]

Parameter(s)

DICT

Specifies the file dictionary.

filename

Name of the file.

item-ID

Identifies the item in file name that contains the stored statements you want to execute.

L

Loads the statements in item-ID into the stack without executing them.

After each command executes, it becomes statement 1 in the stack.

To stop executing the statements stored in the file item, press BREAK. Even though all of the statements in the file item have not been executed, they will all be stored in the stack.

A helpful practice is to create a standard file called TC (for Terminal Commands) to which you can routinely copy (.C) and execute (.R) stack statements.

Executing Statements Stored in a File Item

This example executes the statements stored in item ORDER-REPORTS in the file TC:

>.R TC ORDER-REPORTS

SORT ORDERS BY DATE BY CUST-ID BREAK-ON QUARTER (P)

[The command is executed.]

SORT ORDERS BY DATE BY CUST-ID BREAK-ON MONTH (P)

[The command is executed.]

SORT ORDERS BY DATE BY CUST-ID BREAK-ON WEEK (P)

[The command is executed.]

>

The system displays each statement stored in item ORDER-REPORTS before executing it. These statements are now part of the stack, with the last-executed statement as statement 1.

>.L3

001 SORT ORDERS BY DATE BY CUST-ID BREAK-ON WEEK

002 SORT ORDERS BY DATE BY CUST-ID BREAK-ON MONTH

003 SORT ORDERS BY DATE BY CUST-ID BREAK-ON QUARTER

Loading Statements from a File Item into the Stack

This example loads the statements from the item ORDER-REPORTS in the file TC into the stack:

>.R TC ORDER-REPORTS (L)

>

You can now selectively execute any of the statements with the .X command.

See Also

TCL Stacker Command Reference