Note | This command is defined in a header file and will be preprocessed by the X# preprocessor to a function call. If you disable the standard header (-nostddefs) files then this command will not be available. If you tell the compiler to use a different standard header file (-stddef ) then this command may also be not available |
Enables or disables the evaluation of fields, variables, array elements, functions, or expressions that are surrounded by text-merge delimiters, and lets you specify text-merge output.
SET TEXTMERGE [ON | OFF] [TO [FileName] MEMVAR VarName [ADDITIVE]]
[WINDOW WindowName] [SHOW | NOSHOW]
ON | Specifies that any fields, variables, array elements, functions, or expressions surrounded by the text-merge delimiters be evaluated and output when placed after \ or \\, or between TEXT and ENDTEXT. |
OFF | (Default) Specifies that any fields, variables, array elements, functions, or expressions be literally output along with the text-merge delimiters surrounding them. |
TO [ FileName] | Specifies that output from \, \\, and TEXT ... ENDTEXT be directed to a text file in addition to the main Visual FoxPro window, which is the default. You can also direct the output to a text file by including FileName. If a file with that name doesn't exist, a new file is created. If a file with the same name already exists and SET SAFETY is set to ON, you are given the option of overwriting the existing file. The text file is opened as a low-level file, and its file handle is stored to the _TEXT system variable. You can close the file by issuing SET TEXTMERGE TO without additional arguments. If the file handle of another file was previously stored in _TEXT, that file is closed. |
MEMVAR VarName | Specifies a variable to contain data from TEXTMERGE output. Because SET TEXTMERGE is a global setting and can span several procedures or methods, it is possible for MEMVAR VarName to lose scope. The command will function even when the variable is out of scope, but will return no content. You can control scoping of MEMVAR VarName by declaring the variable. |
ADDITIVE | Specifies that output from \, \\, and TEXT ... ENDTEXT be appended to an existing file or memory variable. |
SHOW | NOSHOW | (Default) SHOW displays text-merge output. NOSHOW suppresses display of text-merge output. By default, output generated by \, \\, and TEXT ... ENDTEXT is sent to the Console window. |
Specifies that any fields, variables, array elements, functions, or expressions surrounded by the text-merge delimiters be evaluated and output when placed after \ or \\, or between TEXT and ENDTEXT.
The following short program example demonstrates how the contents of the variable gcTodayDate and the DATE( ) and TIME( ) functions are evaluated when SET TEXTMERGE is set to ON.
CLEAR
CLOSE DATABASES
SET TEXTMERGE ON
SET TEXTMERGE TO ContactList.TXT
USE customer
TEXT
CONTACT NAMES
<<DATE( )>> <<TIME( )>>
ENDTEXT
WAIT "Press a key to generate the first ten names."
SCAN NEXT 10
TEXT
<<contact>>
ENDTEXT
ENDSCAN
CLOSE ALL
XSharp.VFP.DLL