Difference between revisions of "TEXT"
Yvonne.milne (Talk | contribs) m (1 revision) |
Helen.george (Talk | contribs) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
==Purpose== | ==Purpose== | ||
Display a block of text on the screen or printer | Display a block of text on the screen or printer | ||
− | |||
==Syntax== | ==Syntax== | ||
Line 9: | Line 8: | ||
ENDTEXT | ENDTEXT | ||
− | |||
==See Also== | ==See Also== | ||
− | + | [[SET TEXTMERGE]] | |
==Description== | ==Description== | ||
− | The TEXT and ENDTEXT commands can be used to delimit a block of text that will be output to the screen or printer. | + | The TEXT and ENDTEXT commands can be used to delimit a block of text that will be output to the screen or printer. & macro substitution is performed on the text unless SET MACROS is OFF. All of the text is displayed exactly as it appears within the TEXT and ENDTEXT commands. |
− | + | ||
− | + | ||
====TO <memvar>==== | ====TO <memvar>==== | ||
If the optional TO <memvar> is included, the text will be sent to the memory variable specified in <memvar>. The variable will be created if it does not already exist. The following keywords can also be used in conjunction with TO <memvar>: | If the optional TO <memvar> is included, the text will be sent to the memory variable specified in <memvar>. The variable will be created if it does not already exist. The following keywords can also be used in conjunction with TO <memvar>: | ||
− | + | {| class="wikitable" width="100%" | |
− | {| class="wikitable" | + | !width="30%"|Keyword||Description |
− | !Keyword||Description | + | |
|- | |- | ||
− | |ADDITIVE||If ADDITIVE is specified, the text will be added to the contents of <memvar>, otherwise the contents will be overwritten. | + | |valign="top"|ADDITIVE||If ADDITIVE is specified, the text will be added to the contents of <memvar>, otherwise the contents will be overwritten. |
|- | |- | ||
− | |TEXTMERGE||Operates as if SET TEXTMERGE is ON. | + | |valign="top"|TEXTMERGE||Operates as if SET TEXTMERGE is ON. |
|- | |- | ||
− | |NOSHOW||Disables the display of the text on the screen. | + | |valign="top"|NOSHOW||Disables the display of the text on the screen. |
|- | |- | ||
− | |PRETEXT <expC>||Inserts the specified character expression, <expC> at the start of each delimited line of text. | + | |valign="top"|PRETEXT <expC>||Inserts the specified character expression, <expC> at the start of each delimited line of text. |
|- | |- | ||
− | |PRETEXT <expN>||Specifies a numeric flag (1-7) with the following values: | + | |valign="top"|PRETEXT <expN>||Specifies a numeric flag (1-7) with the following values: |
1 – Eliminates spaces before each delimited line. | 1 – Eliminates spaces before each delimited line. | ||
2 – Eliminates tabs before each delimited line. | 2 – Eliminates tabs before each delimited line. | ||
Line 41: | Line 36: | ||
|- | |- | ||
|} | |} | ||
− | |||
==Example== | ==Example== | ||
<code lang="recital"> | <code lang="recital"> | ||
− | set | + | open database southwind |
− | + | use example | |
− | + | set textmerge to balance.txt | |
− | + | set textmerge delimiters to "{{","}}" | |
− | + | set textmerge on | |
− | + | go top | |
− | + | do while balance > 0 | |
− | + | text noshow | |
− | + | Date: {{date()}} | |
− | set | + | Name: {{last_name}} {{first_name}} |
+ | |||
+ | Account Number : {{account_no}} | ||
+ | Current Balance : {{balance}} | ||
+ | Credit Limit: : {{limit}} | ||
+ | endtext | ||
+ | skip | ||
+ | enddo | ||
+ | set textmerge off | ||
+ | set textmerge to | ||
</code> | </code> | ||
− | |||
− | |||
− | |||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Commands]] | [[Category:Commands]] |
Latest revision as of 11:20, 5 February 2013
Purpose
Display a block of text on the screen or printer
Syntax
TEXT [TO <memvar> [ADDITIVE] [TEXTMERGE] [NOSHOW] [PRETEXT <expC> | <expN>]]
<text to be displayed>
ENDTEXT
See Also
Description
The TEXT and ENDTEXT commands can be used to delimit a block of text that will be output to the screen or printer. & macro substitution is performed on the text unless SET MACROS is OFF. All of the text is displayed exactly as it appears within the TEXT and ENDTEXT commands.
TO <memvar>
If the optional TO <memvar> is included, the text will be sent to the memory variable specified in <memvar>. The variable will be created if it does not already exist. The following keywords can also be used in conjunction with TO <memvar>:
Keyword | Description |
---|---|
ADDITIVE | If ADDITIVE is specified, the text will be added to the contents of <memvar>, otherwise the contents will be overwritten. |
TEXTMERGE | Operates as if SET TEXTMERGE is ON. |
NOSHOW | Disables the display of the text on the screen. |
PRETEXT <expC> | Inserts the specified character expression, <expC> at the start of each delimited line of text. |
PRETEXT <expN> | Specifies a numeric flag (1-7) with the following values:
1 – Eliminates spaces before each delimited line. 2 – Eliminates tabs before each delimited line. 4 – Eliminates carriage returns before each delimited line. Multiple options can be specified by adding the values. |
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 noshow 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