TYPE
Show the content of a file on the console, printer or file
- Syntax
-
- TYPE <xcFile> [TO PRINTER] [TO FILE <xcDestFile>]
- Arguments
-
- <xcFile> is a name of the file to display. If the file have an extension, it must be specified (there is no default value). It can be specified as literal file name or as a character expression enclosed in parentheses.
- TO PRINTER is an optional keyword that specifies that the output should go to both the screen and printer.
- TO FILE <xcDestFile> copy the source <xcFile> also to a file. If no extension is given (.txt) is added to the output file name. <xcDestFile> can be specified as literal file name or as a character expression enclosed in parentheses.
- Description
-
- TYPE command type the content of a text file on the screen with an option to send this information also to the printer or to an alternate file. The file is displayed as is without any headings or formating.
- If <xcFile> contain no path, TYPE try to find the file first in the SET DEFAULT directory and then in search all of the SET PATH directories. If <xcFile> can not be found a run-time error occur.
- If <xcDestFile> contain no path it is created in the SET DEFAULT directory.
- Use SET CONSOLE OFF to suppress screen output. You can pause the output using Ctrl-S, press any key to resume.
Examples
The following examples assume a file name MyText.DAT exist in all
specified paths, a run-time error would displayed if it does not
// display MyText.DAT file on screen
TYPE MyText.DAT
// display MyText.DAT file on screen and printer
TYPE MyText.DAT TO PRINTER
// display MyText.DAT file on printer only
SET CONSOLE OFF
TYPE MyText.DAT TO PRINTER
SET CONSOLE ON
// display MyText.DAT file on screen and into a file MyReport.txt
TYPE MyText.DAT TO FILE MyReport
- Status
- Ready
- Compliance
-
- TYPE works exactly like CA-Clipper's TYPE
- See Also