Set Alternate, Set("Alternate")
The SET
ALTERNATE commands let you send certain kinds of output to a file
as well as to the screen. Think of the output it creates as a
"log file" (but don't confuse it with the log files created by
the Coverage Logging option in the Debugger).
Usage
|
SET ALTERNATE TO [ FileName [ ADDITIVE ] ]
SET ALTERNATE ON | OFF
cOnOrOff = SET("ALTERNATE")
cFileName = SET("ALTERNATE",1)
|
Back when Tamar used to teach dBase, she needed a way for
students to perform a series of commands and turn something in
that showed they'd done it right. Fortunately, someone had added
SET ALTERNATE to the language. The students could see their
output on screen, but a duplicate of it appeared in a file that
could be printed out and turned in. Other than that, we've never
found much use for these commands. Back in ancient Xbase history,
before the TextMerge commands came along, SET ALTERNATE was handy
for creating text files.SET ALTERNATE is confusing to use. (The
students certainly found it so.) It's a two-step process to turn
it on and a two-step process to turn it off (unless you use CLOSE
ALTERNATE). SET ALTERNATE TO lets you specify a file to contain
the output. That file stays in effect until you issue the command
without a file or SET ALTERNATE TO a different file. Actually, of
course, it's all analogous to the SET PRINT commands and provides
you an alternate output file.Once you've established an alternate
file, SET ALTERNATE ON or OFF determines whether eligible output
goes to that file. (Output from ?, ??, DISPLAY and LIST is
eligible.) The text you send to the file is echoed to the active
window unless you SET CONSOLE OFF.
Example
|
SET ALTERNATE TO Test.TXT
USE Employee
* Start logging
SET ALTERNATE ON
LIST First_Name,Last_Name
* Stop logging
SET ALTERNATE OFF
LIST Birth_Date
* Turn off log file
SET ALTERNATE TO
|
Back to Table of Contents
Copyright © 2002-2018 by Tamar E. Granor,
Ted Roche, Doug Hennig, and Della Martin. Click for license
.