run

The function run takes a single parameter, which must be a character string that represents a file name. It will change the current input device to the file specified. The file is supposed to contain any Shang commands, programs, or functions. The contents of the file will be executed, and upon end of file is reached, the input device is changed back to the previous setting (usually user input).

The file name can be an absolute path name, such as

run("D:\my programs\test_program.x")
No special file extension is required, although .x is preferred.

Relative path name can be used, in which case, the current working directory will be added to the path name. The current working directory can be checked and reset using the system commands pwd and cd.



oz 2009-12-22