Difference between revisions of "SET TEXTMERGE"
Yvonnemilne (Talk | contribs) |
Yvonnemilne (Talk | contribs) |
||
(8 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==Purpose== | ==Purpose== | ||
Specify delimiting characters | Specify delimiting characters | ||
Line 12: | Line 5: | ||
==Syntax== | ==Syntax== | ||
SET TEXTMERGE ON | OFF | (<expL>) | SET TEXTMERGE ON | OFF | (<expL>) | ||
+ | |||
SET TEXTMERGE TO [<filename>] [ADDITIVE] | SET TEXTMERGE TO [<filename>] [ADDITIVE] | ||
+ | |||
SET TEXTMERGE DELIMITERS TO [<expC1>] [,<expC2>] | SET TEXTMERGE DELIMITERS TO [<expC1>] [,<expC2>] | ||
+ | |||
==See Also== | ==See Also== | ||
− | + | [[Single Textmerge|\]], [[Double Textmerge|\\]], [[TEXT]] | |
Line 29: | Line 25: | ||
==Example== | ==Example== | ||
− | < | + | <code lang="recital"> |
− | use | + | open database southwind |
+ | use example | ||
set textmerge to balance.txt | set textmerge to balance.txt | ||
− | + | set textmerge delimiters to "{{","}}" | |
set textmerge on | set textmerge on | ||
go top | go top | ||
do while balance > 0 | do while balance > 0 | ||
− | Date: {{date()}} | + | text |
− | Name: {{last_name}} {{first_name}} | + | Date: {{date()}} |
− | + | Name: {{last_name}} {{first_name}} | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
+ | Account Number : {{account_no}} | ||
+ | Current Balance : {{balance}} | ||
+ | Credit Limit: : {{limit}} | ||
+ | endtext | ||
+ | skip | ||
enddo | enddo | ||
set textmerge off | set textmerge off | ||
− | set textmerge to</ | + | set textmerge to |
+ | </code> | ||
==Products== | ==Products== | ||
− | Recital | + | Recital Server, Recital |
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Commands]] | [[Category:Commands]] | ||
− | [[Category:Set_Commands]] | + | [[Category:Set_Commands|TEXTMERGE]] |
+ | [[Category:Input Output]] | ||
+ | [[Category:Input Output Set Commands]] |
Latest revision as of 11:27, 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
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 text Date: {{date()}} Name: {{last_name}} {{first_name}} Account Number : {{account_no}} Current Balance : {{balance}} Credit Limit: : {{limit}} endtext skip enddo set textmerge off set textmerge to
Products
Recital Server, Recital