Partilhar via


TEXTMERGE( ) Function

Provides evaluation of a character expression.

TEXTMERGE(cExpression [, lRecursive [, cLeftDelim [, cRightDelim]]])

Parameters

  • cExpression
    Specifies the string expression to be evaluated.
  • lRecursive
    Specifies whether to repeatedly iterate through all levels of delimiters in cExpression, evaluating until no text merge delimiters remain*.*
  • cLeftDelim
    Specifies the left delimiter to use for the text merge search.
  • cRightDelim
    Specifies the right delimiter to use for the text merge search.

Return Values

Character string. Represents the value of cExpression, the merged text.

Remarks

The cLeftDelim and cRightDelim parameters temporarily override any SET TEXTMERGE DELIMITERS values.

The TEXTMERGE( ) function responds to current settings of SET TEXTMERGE SHOW | NOSHOW.

Example

The following example creates a text string, then outputs the TEXTMERGE of that function.

TEXT to myvar noshow &&textm 
   this is a test   <<datetime()>>
   <<program(-1)>>
   <<myvar>>
   textmerge(myvar) (this line is literal)
   <<doit(myvar)>>   (cause recursion
   END of orig text
endtext
?myvar
?"Now starting textmerge"
?textmerge(myvar)

PROCEDURE doit(myvar)
*  r=i   && cause an error
   if program(-1) > 3
     return "THEEND*********"
   endif
   return textmerge(myvar)

See Also

SET DELIMITERS Command | SET TEXTMERGE Command | SET TEXTMERGE DELIMITERS Command | Creating Character Expressions | TEXT ... ENDTEXT