Type: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
(Imported TYPE command page from old wiki)
 
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The '''Type (TY)''' [[command]] sends the contents of a specified file to the screen, a printer, or another file.
The '''Type (TY)''' command sends the contents of a specified file to the screen, a printer, or another file.


==Comments and Examples==
==Comments and Examples==
[[Text files]] appear in a legible format when displayed with the Type command. The presence of non-alphabetic or non-numeric characters in other files -such as object program files -may make these files illegible, however wildcard characters are not allowed in the file name that specifies the TYPE command. The following example displays, one screen at a time, the contents of the file SAMPLE.ONE:
 
Text files appear in a legible format when displayed with the Type command. The presence of non-alphabetic or non-numeric characters in other files, such as object program files, may make these files illegible.
 
however wildcard characters are not allowed in the file name that specifies the TYPE command.  
 
The following example displays, one screen at a time, the contents of the file SAMPLE.ONE:


  TYPE B:SAMPLE.ONE -P
  TYPE B:SAMPLE.ONE -P
Line 11: Line 16:


==Syntax==
==Syntax==
[[Image:HELP0064.jpg]]
TYPE <file name> [{[>[>]<output file>|PRINT}][-P]
 
[[Image:Type.png]]


==Defaults==
==Defaults==
# Display the information on the screen.
# Display the information on the screen.
# Scroll entire contents of file without pausing.
# Scroll entire contents of file without pausing.


==Parameters==
==Parameters==
The TYPE command requires the '''file name''' parameter, which specifies which file the system should display on the screen or send to a printer or file.
The TYPE command requires the '''file name''' parameter, which specifies which file the system should display on the screen or send to a printer or file.


The optional '''>file name''' parameter (with the redirection arrow) indicates the file or device to which the contents of the specified file should be sent. One redirection arrow causes the information to be written over any data that previously existed in the file. Two redirection arrows (>>) causes the information to be appended to the end of the file.
The optional '''>redirected output file''' parameter indicates the file or device to which the contents of the specified file should be sent. One redirection arrow causes the information to be written over any data that previously existed in the file. Two redirection arrows '''>>''' causes the information to be appended to the end of the file.


'''PRINT''', which operates the same as >PRN:, sends the contents of the specified file to a printer rather than to the screen.
'''PRINT''', which operates the same as '''>PRN:''', sends the contents of the specified file to a printer rather than to the screen.


Note- TYPE PRINT does not utilize printer substitutions, but Ctrl-P does.
'''Note''' that TYPE PRINT does not utilize printer substitutions, but Ctrl-P does.


The '''-P''' option causes scrolling to pause after the typed contents of the file fills one screen.
The '''-P''' option causes scrolling to pause after the typed contents of the file fills one screen.


==Comments==
==Other Considerations==
# TYPE now works on locked files.
 
# TYPE works on locked files.
# TYPE PRINT no longer inserts carriage returns in long print lines, unless they are going to the screen. This was fixed earlier for files. Now it is fixed for typing to printers as well.
# TYPE PRINT no longer inserts carriage returns in long print lines, unless they are going to the screen. This was fixed earlier for files. Now it is fixed for typing to printers as well.


{\b TYPE COMMAND REVISIONS}
'''Note''' that TYPE skips the header portion of Internal files)
 
===Printer Escape Sequences===
As of 4.2, TYPE translates printer escape sequences.


The TYPE command was reviewed and revised under various scenarios:
With the following syntax:
[NEWCELL(icells4.spc)]


TYPE filename >destination [PRINTER_TYPE= HP3]


|}
Printer translation is done in accordance with the destination printer name matching that is done at OPEN time for printer files (same as NAME=PRN:/printer etc). The optional PRINTER_TYPE= specification is valid only if the destination is a display file. It is matched against the second parameter of configuration file PRINTER statements.
(only honor ^Z only when concatenating files )|||


|}
TYPE PRT\report-file  >PREVIEW:/HP4
(note- TYPE skips the header portion of Internal files)
This will translate HP4 printer escape sequences embedded in report-file.


TYPE PRT\report-file1  >report-file2  PRINTER_TYPE=HP4
This will copy file1 to file 2 interpreting HP4 printer escape sequences.


In contrast, [[COPY]] supports copying a print file unaltered to a printer. The following example will copy one to the other unaltered:
COPY PRT\EDITLIST.255  DIRECT:/HP4


<noinclude>
<noinclude>

Latest revision as of 20:41, 22 September 2014

The Type (TY) command sends the contents of a specified file to the screen, a printer, or another file.

Comments and Examples

Text files appear in a legible format when displayed with the Type command. The presence of non-alphabetic or non-numeric characters in other files, such as object program files, may make these files illegible.

however wildcard characters are not allowed in the file name that specifies the TYPE command.

The following example displays, one screen at a time, the contents of the file SAMPLE.ONE:

TYPE B:SAMPLE.ONE -P

The next command sends the same contents to a printer:

TYPE B:SAMPLE.ONE PRINT

Syntax

TYPE <file name> [{[>[>]<output file>|PRINT}][-P]

Defaults

  1. Display the information on the screen.
  2. Scroll entire contents of file without pausing.

Parameters

The TYPE command requires the file name parameter, which specifies which file the system should display on the screen or send to a printer or file.

The optional >redirected output file parameter indicates the file or device to which the contents of the specified file should be sent. One redirection arrow causes the information to be written over any data that previously existed in the file. Two redirection arrows >> causes the information to be appended to the end of the file.

PRINT, which operates the same as >PRN:, sends the contents of the specified file to a printer rather than to the screen.

Note that TYPE PRINT does not utilize printer substitutions, but Ctrl-P does.

The -P option causes scrolling to pause after the typed contents of the file fills one screen.

Other Considerations

  1. TYPE works on locked files.
  2. TYPE PRINT no longer inserts carriage returns in long print lines, unless they are going to the screen. This was fixed earlier for files. Now it is fixed for typing to printers as well.

Note that TYPE skips the header portion of Internal files)

Printer Escape Sequences

As of 4.2, TYPE translates printer escape sequences.

With the following syntax:

TYPE filename >destination [PRINTER_TYPE= HP3]

Printer translation is done in accordance with the destination printer name matching that is done at OPEN time for printer files (same as NAME=PRN:/printer etc). The optional PRINTER_TYPE= specification is valid only if the destination is a display file. It is matched against the second parameter of configuration file PRINTER statements.

TYPE PRT\report-file   >PREVIEW:/HP4

This will translate HP4 printer escape sequences embedded in report-file.

TYPE PRT\report-file1  >report-file2   PRINTER_TYPE=HP4

This will copy file1 to file 2 interpreting HP4 printer escape sequences.

In contrast, COPY supports copying a print file unaltered to a printer. The following example will copy one to the other unaltered:

COPY PRT\EDITLIST.255  DIRECT:/HP4