Difference between revisions of "TYPE"

From Recital Documentation Wiki
Jump to: navigation, search
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Class==
 
Input/Output
 
 
 
 
==Purpose==
 
==Purpose==
 
Display a text file on the screen or printer
 
Display a text file on the screen or printer
Line 22: Line 18:
  
 
====TO PRINT====
 
====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.
+
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.
  
  
Line 29: Line 25:
 
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)
 
     type file &file to print
 
     type file &file to print
 
     file = dir("*.prg", .F.)
 
     file = dir("*.prg", .F.)
Line 38: Line 34:
  
 
==Products==
 
==Products==
Recital Database Server, Recital Mirage Server, Recital Terminal Developer
+
Recital Server, Recital  
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Commands]]
 
[[Category:Commands]]
 +
[[Category:Input Output]]
 +
[[Category:Input Output Commands]]

Latest revision as of 16:27, 25 November 2009

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