Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
101 VFP7 Things, Part 19 - TextMerge()
Message
 
 
To
08/01/2001 19:05:20
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00460905
Message ID:
00461278
Views:
15
TEXTMERGE and TEXT - ENDTEXT also allows output to a memvar.

For example: You need to build a long sql statement into a string for remote database access. Instead of
lFld1 = "SMITH"
lFld2 = "JOHN"
SqlStr = "SELECT *"
SqlStr = SqlStr + " From YourTable"
SqlStr = SqlStr + " Where LastName = '" + lFld1 + "'"
SqlStr = SqlStr + " AND FirstName = '" + lFld2 + "'"
SqlStr = SqlStr + " AND ActiveCustomer = 'Y'"
You can
lFld1 = "SMITH"
lFld2 = "JOHN"
TEXT to SqlStr TEXTMERGE NOSHOW
SELECT *
 FROM YourTable
 WHERE LastName = '<<lFld1>>'
   AND FirstName = '<<lFld2>>'
   AND ActiveCustomer = 'Y'
ENDTEXT
SqlStr = STRTRAN(SqlStr,CHR(13)+chr(10),"")
Wish there was a clean way to prevent the CRLF without using a STRTRAN or the // prefix with Textmerge.
Michael McLain
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform