Difference between revisions of "TYPE"

From Recital Documentation Wiki
Jump to: navigation, search
 
Line 30: Line 30:
 
==Example==
 
==Example==
 
<code lang="recital">
 
<code lang="recital">
set printer to spooler
+
set printer to \\spooler
 
file = dir("*.prg", .T.)
 
file = dir("*.prg", .T.)
 
do while .not. empty(file)
 
do while .not. empty(file)

Revision as of 10:40, 16 March 2009

TYPE

Class

Input/Output


Purpose

Display a text file on the screen or printer


Syntax

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


See Also

ALIAS, 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 Database Server, Recital Mirage Server, Recital Terminal Developer