Contents Previous Next Subchapters

Running All the Files in a Directory
Syntax runall(dirwait)
See Also execfile , include

Description
Runs all the *.OMS and *.oms files that are in the directory specified by that character row vector dir. The current working directory is set to dir during execution of the files and then is restored to its original value. The nonnegative integer scalar wait specifies the number of seconds to wait between running each file. If wait is not zero, each file is displayed in an editor window while it is being executed. Nonzero wait values are good for demonstrations and the zero wait value is good for automated testing.

Example
Suppose that the directory c:\omwin\temp only contains the files temp1.oms and temp2.oms where temp1.oms contains
     clear
     gplot(seq(10))
     gupdate
and temp2.oms contains
     clear
     gplot(seq(10)^2)
     gupdate
If you enter
     dir  = "c:\omwin\temp"
     wait = 5
     runall(dir, wait)
O-Matrix will execute and display the two files.