SET ALTERNATE

From Recital Documentation Wiki
Revision as of 04:25, 12 March 2009 by Barrymavin (Talk | contribs)

Jump to: navigation, search

SET ALTERNATE

Class

Input/Output


Purpose

Capture output text in a file


Syntax

SET ALTERNATE ON | OFF | (<expL>) SET ALTERNATE TO [<.txt filename> | (<expC>)]


See Also

CLOSE ALTERNATE, SET DEVICE, PRINT, SET PRINT, SET PRINTER


Description

The SET ALTERNATE command provides the ability to record all textual output into a file. This command is primarily used when generating reports, which can later be printed on the system printer with the PRINT command. Full screen form operations are not recorded in the alternate file, but @...SAY commands are.

The SET ALTERNATE TO command is used to specify the target filename for the operation. If no filename extension is specified, then ’.txt’ is used. The filename can be substituted with an <expC>, enclosed in round brackets, which returns a valid filename.

You may enable and disable the writing of output to the alternate file with the SET ALTERNATE ON and OFF command. To close the alternate file use either the CLOSE ALTERNATE command or issue a SET ALTERNATE TO with no filename specified.

If SET ALTERNATE ON is issued, and no SET ALTERNATE TO <.txt filename> is active, then the alternate filename ’alternate.txt’ will be used. This command allows the optional logical expression <expL> to be evaluated. If a value of .T. is returned, ALTERNATE is set ON. If a value of .F. is returned, ALTERNATE is set OFF. Note that <expL> should be enclosed in round brackets.

By default, ALTERNATE is OFF.


Example

set alternate to alt
? [Write this text to file]
set alternate off
? [Don’t write this text to file]
?
set console off
set screenmap off
set device to print
set alternate on
setprc(0,0)			// set coordinates to 0,0
@1,0 say [write this to file to the file, not to the screen]
close alternate
set console on
set screenmap on
set device to screen
return

Products

Recital Database Server, Recital Mirage Server, Recital Terminal Developer