TYPE

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 formatting.

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

Compliance

Clipper

Seealso

COPY FILE, SET DEFAULT, SET PATH, SET PRINTER, __TypeFile()

2 responses to “TYPE

  1. Pingback: Harbour Commands | Viva Clipper !

  2. Pingback: Harbour RG Summary | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.