Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
101 VFP7 Things, Part 19 - TextMerge()
Message
 
À
08/01/2001 19:05:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00460905
Message ID:
00461278
Vues:
17
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform