TEXT

From Lianjapedia
Jump to: navigation, search

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