_TEXT System Memory Variable Example

The following program demonstrates how to direct text merge output to alternate files:

SET TALK OFF
SET TEXTMERGE ON NOSHOW      && Enable text merge, no output to screen
SET TEXTMERGE DELIMITERS TO   && Default text merge delimiters <<,>>
SET TEXTMERGE TO date.txt   && Create and send output to date.txt
STORE _TEXT TO gcDateHandle   && Save date.txt's file handle
STORE -1 TO _TEXT         && Output off to date.txt; keep it open
SET TEXTMERGE TO time.txt   && Create and send output to time.txt
STORE _TEXT TO gcTimeHandle   && Save time.txt's file handle
*** Send the following text to time.txt ***
\The time is:
STORE gcDateHandle TO _TEXT    && Now direct output to date.txt
*** Send the following text to date.txt ***
\Today's date is:
STORE gcTimeHandle TO _TEXT   && Now direct output to time.txt
*** Output the time on the same line ***
\\ <<TIME( )>>
STORE gcDateHandle TO _TEXT   && Now direct output to date.txt
*** Output the date on the same line ***
\\ <<DATE( )>>
CLOSE ALL  && Close all files
TYPE date.txt  && See what's in this file...
WAIT WINDOW  && Pause
TYPE time.txt  && ...and what's in this file
ERASE date.txt
ERASE time.txt