Skip to main content
How Can We Help?
< All Topics
Print

SET OUTPUT

Specifies the current output.

Syntax

SET OUTPUT docname [APPEND] [FILEPATH options]

Parameters

docnameThe name of the application document to which all output is to be sent. Can also be one of the two pre-defined application documents, terminal or printer.
APPENDSpecifies that new output to docname is to be appended to the output already existing in the application document (if any).
FILEPATH optionsSpecifies that the input document will be governed by the options as follows:

file://<the full path of a text file> – subsequent ZIM statements referring to the docname above will read this physical file instead;

port://name:speed:bits:parity:stopbits:CTS – It only works for Linux environments and specifies a serial port to be read;

connector://IP address:port – reads from the specified IP address (or URL) using that port number;

pipe://<OS command> – executes the OS command.

fifo://<FIFO name> – reads records from the FIFO name.

Comments

The SET OUTPUT command specifies the application document that is to receive the output from all subsequent FORM REPORT, GENERATE, LIST, OUTPUT, PRINT, REPORT FROM, and SELECT commands. The setting remains in effect until changed by a subsequent SET OUTPUT command.

The software provides two pre-defined application documents, terminal and printer, that correspond to your terminal screen and default printer, respectively. OUTPUT is set to Terminal by default. If set to printer, the SET OUTPUT command has no impact on the format in which the report prints; use $setproperty to change print properties for a report.

The APPEND option is not valid in combination with the option FILEPATH.

The FILEPATH “file:…” is an excelent way of providing an output file without creating a new document.

The FILEPATH “pipe:…” allows to execute any operating system command without creating a specific document for it.

The FILEPATH “fifo:…” writes records to a FIFO (in memory) for subsequent read by another Zim program using SET INPUT FILEPATH “fifo…”. Many programs (producers) can write to a FIFO, but usually only one (consumer) reads from it.

Example

set output MyDoc append
set output printer
report from ...
... other commands ...
endreport
set output terminal

This example shows how to write a document anywhere in the system. The first SET OUTPUT sets the output to “c:\myDir\FirstFile.txt” while the second sets it to “c:\myDir\SecondFile.txt”.

set output MyDoc filepath "file://c:\\myDir\\FirstFile.txt"
list 20 zimprof
set output MyDoc filepath "file://c:\\myDir\\SecondFile.txt"
list all AnotherDoc
set output terminal

See more examples in the command SET INPUT.

Deixe um comentário

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *

pt_BRPortuguese