TYPE

From Recital Documentation Wiki
Jump to: navigation, search

Purpose

Display a text file on the screen or printer


Syntax

TYPE [FILE] <.txt filename> | (<expC>) [TO PRINT]


See Also

ALIAS, DB_PRINT, PRINT, SET PAGELENGTH


Description

The TYPE command displays the specified text file on the screen. If no filename is specified, '.txt' is used. The file name can be substituted with an <expC>, enclosed in round brackets, which returns a valid filename.

FILE

If the optional FILE keyword is specified, then the text file will be displayed in pages, with line numbers, and the name of the file will be displayed as a heading above each page. The length of each page may be specified with the SET PAGELENGTH TO command. This feature is particularly useful for producing program listings.

TO PRINT

If the optional TO PRINT clause is specified, then the file will be output to the printer. The TO PRINT option will default to a local printer unless the command SET PRINTER TO \\SPOOLER is issued. SET PRINTER TO \\SPOOLER causes the file to be spooled to the system printer defined by the environment variable DB_PRINT.


Example

set printer to \\spooler
file = dir("*.prg", .T.)
do while not empty(file)
    type file &file to print
    file = dir("*.prg", .F.)
enddo
set printer to


Products

Recital Server, Recital