RepeatCommandDoc.tioga
Copyright © 1986 by Xerox Corporation. All rights reserved.
Carl Hauser, May 7, 1986 5:23:34 pm PDT
Wes Irish, May 25, 1988 11:09:49 am PDT
RepeatCommand
CEDAR 6.0 —
RepeatCommand
Postponing and Iterating Command Tool Commands
Carl Hauser
© Copyright 1986 Xerox Corporation. All rights reserved.
Abstract: A Cedar interface and commands for executing other commands sometime in the future. These future commands may be executed once or on a schedule comprising a start time, a period, and a number of iterations.
Created by: Carl Hauser
Maintained by: Carl Hauser <CHauser.pa>
Keywords: Command, delay, postpone, iterate, At
XEROX  Xerox Corporation
   Palo Alto Research Center
   3333 Coyote Hill Road
   Palo Alto, California 94304

RepeatCommand
RepeatCommand is a program for executing other Cedar commands at some time in the future. The execution may be iterated, if desired. An upper limit can be placed on the number of iterations, and the iteration period can be controlled.
The implementation provides access from other Cedar programs through the RepeatCommand interface, which provides the single procedure
Repeat: PUBLIC PROC [cmd: Rope.ROPE, period: INT ← Days, start: BasicTime.GMT ← Immediately, nTimes: INT ← Forever];
It also registers two CommandTool commands with the syntax:
Repeat "Command line to be performed" [period ["Start time interpretable by Tempus" [nTimes]]] [&]
 period defaults to 24*60*60 (one day)
 startTime defaults to BasicTime.Now[]
 nTimes defaults to LAST[INT]
 use the & (as usual) if you want this forked
At "Start time interpretable by Tempus" "Command line to be performed" [&]
 use the & (as usual) if you want this forked
Note the quoting of the command line and the start time, since in general, they will consist of more than a single token. Commands may be aborted by using the STOP! button. Some examples follow:
Repeat "NetworkInfo" 3600 "now" 24 &
At "in 2 minutes" "← MessageWindow.Blink[]"
At 2:00am "pushv commands; bringover -mp Environment.df; pop" &