>So, I then hit on the idea of loading the SQL statement in with a
>TEXT...ENDTEXT command such as:
>
> TEXT TO m.pcSQLCommand
>
> SELECT OrderNo, CustNo, CustName, ShipCity
> FROM OrderHdr
> WHERE OrderNo = 'm.pcOrderNo'
>
> ENDTEXT
>
>This is more readable but it has some drawbacks such as resolution of the VFP
>memory variable. I tried doing a macro substitution of the m.pcOrderNo
>variable but it would not do the substitution within the TEXT...ENDTEXT
>command. It also would not resolve it when the m.pcSQLCommand variable was
>passed to the SQLExec()function. I had to add a SUBSTR() function after the
>TEXT...ENDTEXT command to substitute the string m.pcOrderNo with the actual
>value of the variable.
From the VFP help on TEXT...ENDTEXT:
"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. "