TEXT ... ENDTEXT Command

Example   See Also

Outputs lines of text, the results of expressions and functions, and the contents of variables.

Syntax

TEXT
  TextLines

ENDTEXT

Arguments

TextLines

Specifies the text sent to the current output device. TextLines can consist of text, memory variables, array elements, expressions, functions or any combination of these.

Expressions, functions, memory variables, and array elements specified with TextLines are evaluated only if SET TEXTMERGE is ON and must be enclosed in the delimiters specified by SET TEXTMERGE DELIMITERS. If SET TEXTMERGE is OFF, the expressions, functions, memory variables, and array elements are output as literals along with their delimiters.

For example, today's date is output if SET TEXTMERGE is ON and a text line contains <<DATE( )>>. If SET TEXTMERGE is OFF, <<DATE( )>> is output literally.

If you place comments within TEXT and ENDTEXT or after \ or \\, the comments are also output.

Remarks

This structured programming command sends text lines placed between TEXT and ENDTEXT to the main Visual FoxPro window, a user-defined window, a printer, a text file, or a low-level file.

TEXT sends the text lines to the current output device. This continues until an ENDTEXT statement is encountered or until the program ends.

By default, output from TEXT ... ENDTEXT is sent to the main Visual FoxPro window or the active window. Issue SET CONSOLE OFF to suppress output to the main Visual FoxPro window or the active window. Use SET PRINTER to send output to a printer or a text file.

Output from TEXT ... ENDTEXT can also be sent to a low-level file created or opened with FCREATE( ) or FOPEN( ). If a file handle returned by FCREATE( ) or FOPEN( ) is stored to the _TEXT system variable, output is directed to the corresponding low-level file.