Difference between revisions of "SET TEXTMERGE"

From Recital Documentation Wiki
Jump to: navigation, search
Line 26: Line 26:
 
==Example==
 
==Example==
 
<code lang="recital">
 
<code lang="recital">
use test
+
open database southwind
 +
use example
 
set textmerge to balance.txt
 
set textmerge to balance.txt
set textmerge to delimiters to "{{","}}"
+
set textmerge delimiters to "{{","}}"
 
set textmerge on
 
set textmerge on
 
go top
 
go top

Revision as of 11:22, 27 November 2012

Purpose

Specify delimiting characters


Syntax

SET TEXTMERGE ON | OFF | (<expL>)

SET TEXTMERGE TO [<filename>] [ADDITIVE]

SET TEXTMERGE DELIMITERS TO [<expC1>] [,<expC2>]


See Also

\, \\, TEXT


Description

The SET TEXTMERGE ON | OFF command determines whether expressions that have been enclosed by the text merge delimiters will be evaluated, or output literally. When SET TEXTMERGE is ON, delimited expressions are evaluated and then output to the screen or to a file. If SET TEXTMERGE is OFF, delimited expressions are output literally. Delimited expressions may include table field names, memory variables, and functions. The default text delimiters are << and >>. To use a different set of characters to delimit text, use the SET TEXTMERGE DELIMETERS command. Delimited text is output when it is placed after the and commands, or when it is between the TEXT...ENDTEXT commands. When SET TEXTMERGE is ON, expressions placed within the TEXT...ENDTEXT commands are evaluated and merged with text.

The SET TEXTMERGE TO command directs delimited text to an output file. If the name of the text file, as specified by <filename>, already exits, the file will be overwritten unless the ADDITIVE keyword is used. If the text file does not exist and the ADDITIVE qualifier is used, the file will be created. If the file does exist, then the text will be appended to the end of the text file. If the command SET TEXTMERGE TO is issued without a <filename>, all output will be directed to the current output device, such as the screen or a window.

The SET TEXTMERGE DELIMITERS TO command is used to specify the delimiting characters. The first character expression, <expC1>, is used to specify the beginning text delimiter. If only one character expression is specified, the same character is used to delimit the beginning and ending of text. The second character expression, <expC2>, is used to specify the ending text delimiter. If no character expressions are specified, the SET TEXTMERGE DELIMITER TO command restores the delimiting characters to << and >>.


Example

open database southwind
use example
set textmerge to balance.txt
set textmerge delimiters to "{{","}}"
set textmerge on
go top
do while balance > 0
 
    Date: {{date()}}
    Name: {{last_name}}  {{first_name}}
 
    Account Number  :  {{account_no}}
    Current Balance  :   {{balance}}
    Credit Limit:        :   {{limit}}
 
enddo
set textmerge off
set textmerge to


Products

Recital Server, Recital