INPUT

Example

INPUT reads a stream of TSP commands from an external (disk) file and executes them as a unit.

INPUT [filename] ;

or

INPUT 'filename string' ;

Usage

With INPUT you can use a file of TSP commands you have already written. The input file does not have to be a complete TSP program; you may use disk files as a convenient way to store frequently used pieces of your programs, such as user defined procedures (PROCs), or tables of data to load.

INPUT takes one filename only as an argument. If it is not enclosed in quotes, the filename must conform to restrictions placed on TSP variable names: it must be limited to eight characters and the filename extension must be omitted (.tsp will be assumed). With quotes, the filename can include directory information and extensions and can be up to 128 characters long.

In interactive mode, if the filename is absent, you will be prompted for it. In this case you may also specify a directory as well as an extension or disk unit, but the whole name must be 128 characters or less. Again, if the extension is omitted, .tsp will be assumed.

You will also be prompted to have the file's output displayed on screen as it executes, or to have it sent to another file. Either way, the commands read and executed become part of your TSP session, and may be REVIEWed, EDITed, EXECed, etc.... If you send the output to a disk file, you will be prompted for an output filename. This name may also be up to 128 characters long. If no extension is given, .out will be assumed. If you do not provide a filename, it will default to the same name as the input file except with the .out extension. If another file already has this name, it will be overwritten, unless your system allows multiple versions of the same file.

If you want the command stream to be read and stored but NOT executed, use an EXIT command at the end of the input file instead of END. This is the same as using the EXIT command in collect mode. You may then REVIEW the commands read, and EXEC selected sections.

INPUT commands can be nested (they may appear in files used for input). login.tsp is a special INPUT file; it is read automatically at the start of interactive sessions and batch jobs (this is useful for setting default options).

Examples

1? INPUT ILLUS

Do you want the output printed at the terminal (y/n)? [y]N

Enter name of TSP output file:

This example reads the illustrative example from ILLUS.TSP in the current directory, and places the output in ILLUS.OUT. When execution is finished, the prompt will reappear on screen; the exact line number will depend on how many lines were read from the INPUT file. REVIEW would display everything that had been read.