Difference between revisions of "SET ALTERNATE"

From Lianjapedia
Jump to: navigation, search
m (1 revision)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Capture output text in a file
 
Capture output text in a file
 
  
 
==Syntax==
 
==Syntax==
Line 7: Line 6:
  
 
SET ALTERNATE TO [<.txt filename> | (<expC>)]
 
SET ALTERNATE TO [<.txt filename> | (<expC>)]
 
  
 
==See Also==
 
==See Also==
[[CLOSE ALTERNATE]], [[PRINT]], [[SET DEVICE]], [[SET PRINT]], [[SET PRINTER]]
+
[[CLOSE ALTERNATE]], [[SET CONSOLE]]
 
+
  
 
==Description==
 
==Description==
Line 23: Line 20:
  
 
By default, ALTERNATE is OFF.
 
By default, ALTERNATE is OFF.
 
  
 
==Example==
 
==Example==
Line 33: Line 29:
 
?
 
?
 
set console off
 
set console off
set screenmap off
+
? "write this to file to the file, not to the screen"
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
 
close alternate
 
set console on
 
set console on
set screenmap on
 
set device to screen
 
 
return</code>
 
return</code>
 
==Products==
 
Recital Server, Recital
 
  
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Commands]]
 
[[Category:Commands]]
 
[[Category:Set_Commands|ALTERNATE]]
 
[[Category:Set_Commands|ALTERNATE]]
[[Category:Input Output]]
 
[[Category:Input Output Set Commands]]
 

Latest revision as of 07:38, 4 February 2013

Purpose

Capture output text in a file

Syntax

SET ALTERNATE ON | OFF | (<expL>)

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

See Also

CLOSE ALTERNATE, SET CONSOLE

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
? "write this to file to the file, not to the screen"
close alternate
set console on
return