Command TYPE Foundation

Displays the contents of a text file.

Syntax
TYPE <cFilename> [TO PRINTER] [TO FILE <cTextFile>]
Parameters
<cFilename>
<cFilename> specifies the name of the file whose contents are displayed or output. The name must contain the drive and path, if necessary. It can be specified as a literal file name or as a character expression in parentheses.
PRINTER
The option TO PRINTER also outputs the contents of the file <cFilename> to the printer.
<cTextFile>
The option TO FILE <cTextFile> optionally outputs the contents of the file to another file. The file name must contain the drive and path, if necessary. It can be specified as a literal file name or as a character expression in parentheses. When the file name is specified without a file extension, ".TXT" is used by default.
Description

The command TYPE displays the contents of a text file on the screen. The display can be paused by pressing the key combination Ctrl+S. Output can also occur at the printer and/or to another text file. To suppress output on the screen, the command SET CONSOLE OFF must be called before executing TYPE.

When the file name <cFilename> contains no drive and/or path specification, a search for the file is performed first in the default directory specified using SET DEFAULT and then in the path list defined using SET PATH. If an output file is specified without drive and/or path, it is created in the default directory specified with SET DEFAULT.

Examples
TYPE
// The example prints a source code file. 

PROCEDURE Main 

   SET CONSOLE OFF 
   TYPE Test.prg TO PRINTER 
   SET CONSOLE ON 

RETURN 
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.