Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TEXTMERGE with variables
Message
De
05/07/2011 12:00:01
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
À
05/07/2011 05:37:54
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01517278
Message ID:
01517314
Vues:
82
>Hello.
>
>I'm trying to create a end user query generator. For that I need to let the user enter variables and then select statements using those variables.
>
>After that I have to create the final select statement.
>
>So far I have this:
>
>qp1 = "Lima"
>Sql = "Select * from customer where city =  '<<qp1>>' "
>TEXT TO lcSQL NOSHOW TEXTMERGE
>  <<Sqlt>>
>ENDTEXT
>?    lcSQL
>
> I was hoping to obtain "Select * from customer where city = 'Lima' " but I get
Select * from customer where city =  '<<qp1>>'
instead.
>
>Any help or equivalent approach?

You tried recursive merge here - you're textmerging Sqlt into lcSQL, but Sqlt already contains a mergeable expression. Text/endtext does only one level. TextMerge() function has the 2nd parameter which you can set to achieve recursion (and you can lock your app if the recursion has no end).

In this case, standard practice is to do a single level merge in text/endtext, for readability:
qp1 = "Lima"
TEXT TO lcSQL NOSHOW TEXTMERGE
Select * from customer where city =  '<<qp1>>' 
ENDTEXT
?    lcSQL

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform