OUTPUT (Short Name: OUT)
Top  Previous  Next

Use the OUTPUT command to direct messages and results of commands to a file, printer, screen, or a combination of the three destinations.

output

Options

APPEND
Appends data to the end of an existing file without overwriting the file. If you specify APPEND when the specified file does not exist, R:BASE creates the file with that name.

BOTH

Refers to PRINTER and SCREEN.

CHECK

Checks for file existence and prompts the user for confirmation before writing to it.

ENCRYPT
A 512-bit encryption method is used to obscure any outout information, making it unreadable without R:BASE and your decryption password. Immediately after using the ENCRYPT parameter in your OUTPUT command, you will be prompted for a password. The password is limited 32 characters.

When running encrypted files with R:BASE, you would RUN the file followed by the password. When opening an encrypted file, you will be prompted for the password.

filespec

Indicates the output device. Specify a file name, with or without an extension. You can also specify a drive and/or path.

printer

Indicates the output device. Printer is either the word PRINTER or a valid output port such as LPT1 or COM1. An output port is treated as a file that is automatically copied to the printer device when an OUTPUT SCREEN command is issued.

SCREEN

Indicates the output device is the screen.

filename.PDF PDF
Will create the output as PDF.

About the OUTPUT Command

The default output device is the screen. After sending data to a printer or file, change the output device to the screen. When using the OUTPUT filespec command, you might lose the data in the file if you exit from R:BASE without sending an OUTPUT SCREEN command to close the file.

You cannot combine two filespec designations such as OUTPUT filespec WITH filespec.

R:BASE cannot tell that the argument LPT1 or COM1 is not the name of a file. For example, if you use the command OUTPUT LPT1, R:BASE creates a file named LPT1. Because R:BASE thinks LPT1 is a file, R:BASE does not print the last buffer of output until you redirect output to the screen.

Sending Data to a Printer
Printer refers to the system default printer. In Windows to change a printer, choose Print Setup from the File menu, or change it in the Windows Control Panel Setup. In DOS, printer refers to the printer that is attached to LPT1.

If you are using R:BASE on a local area network, you can direct output to any printer to which you have network access. A common method is to enter the OUTPUT command followed by either the network name of the printer or the printer port on the server.

Sending Data to the Screen
The SET LINES command determines how many lines display on a screen. If a file contains more lines than are designated to display on a screen, R:BASE pauses after each screen display. When displaying a report on a screen, the number of lines specified in the report are displayed.

If the primary output device is a file or a printer and the secondary output device is the screen, R:BASE pauses after each screen display.

Backing Up with OUTPUT
The OUTPUT command can be used with the BACKUP or UNLOAD commands to back up your database to a file. If some part of the command is incorrect-for example, if you fail to specify the correct user identifier for the database-the resulting file contains only the error message produced by the incorrect entry. Use the TYPE or DISPLAY command to display the contents of the file and view the results.

Using SET ECHO ON
To send both your commands and the results of the commands to an output device, enter the command SET ECHO ON before beginning the OUTPUT session. The SET ECHO OFF command only sends command results to an output device.

Examples

In the following example, the OUTPUT command sends data and messages to the printer and simultaneously displays the data and messages on screen with pauses between screens, if needed.

OUTPUT PRINTER WITH SCREEN

In the following example, the first OUTPUT command directs output to the BACKUP.DAT file on drive A:. The UNLOAD command sends the data stored in the transmaster table to the file. The second OUTPUT command closes the file and redirects output to the screen.

OUTPUT a:backup.dat
UNLOAD DATA FOR transmaster
OUTPUT SCREEN

The following command sends data and messages to the printer, designated as COM1. COM1 is treated as a file that is automatically copied to a printer device when the OUTPUT SCREEN command is issued.

OUTPUT COM1

Additional parameters of FONTNAME and FONTSIZE expands the use of printer outputs with your favorite fonts and size.

OUTPUT PRINTER <FONTNAME font name> <FONTSIZE font size>

The default font name is Courier New and font size 10.

Example 01:

OUTPUT PRINTER 
SELECT Company, CustCity, CustState FROM Customer 
OUTPUT SCREEN 
-- Resulting output will be Courier New 10

Example 02:

OUTPUT PRINTER FONTSIZE 8 
SELECT Company, CustCity, CustState FROM Customer 
OUTPUT SCREEN 
-- Resulting output will be Courier New 8

Example 03:

OUTPUT PRINTER FONTSIZE 12 
SELECT Company, CustCity, CustState FROM Customer 
OUTPUT SCREEN 
-- Resulting output will be Courier New 12

Example 04:

OUTPUT PRINTER FONTNAME Arial FONTSIZE 10 
SELECT Company, CustCity, CustState FROM Customer 
OUTPUT SCREEN 
-- Resulting output will be Arial 10

Example 05:

OUTPUT CustomerList.PDF PDF
SELECT Company FROM Customer ORDER BY Company
OUTPUT SCREEN 

Then, either you can view the PDF output using the LAUNCH CustomerList.PDF command or e-mail to someone as an attachment