Difference between revisions of "TEXT"

From Lianjapedia
Jump to: navigation, search
m (1 revision)
 
(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==
[[@...SAY]], [[SET DEVICE]], [[TREPORT]]
+
[[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 Recital/4GL performs & macro substitution on the text unless SET MACROS is OFF.  All of the text is displayed exactly as it appears within the TEXT and ENDTEXT commands.
+
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.
 
+
If SET PRINT is ON, then the text will be output to the printer.  The printer can be assigned to be the system printer, a location specific printer, or a printer attached to the printer port of the issuing terminal.  See the SET PRINTER TO command for full details.  If SET ALTERNATE is ON, then the text will be output to the alternate file.
+
  
 
====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 print on
+
open database southwind
TEXT
+
use example
The following patrons attended the
+
set textmerge to balance.txt
BALLET event on 01/10/1999
+
set textmerge delimiters to "{{","}}"
-------------------------------------
+
set textmerge on
ENDTEXT
+
go top
use patrons index events, dates, namesseek "BALLET"
+
do while balance > 0
list off name, seats, amount;
+
    text noshow
   while event = "BALLET"
+
    Date: {{date()}}
set print off
+
    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>
  
 
==Products==
 
Recital Server, Recital
 
 
[[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

SET TEXTMERGE

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