Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Condition in code text endtext
Message
De
12/06/2005 06:47:55
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01022574
Message ID:
01022578
Vues:
11
>Hi all,
>
>How can i place a condition in code text endtext ?
>
>
> nOrdre = 1
>
>  TEXT TO lcSql NOSHOW TEXTMERGE
>  SELECT  LEFT( T.cnomteleph , 20 )  + ' - F.' + TRANSFORM( Ve.cnofact , "99999999" ) AS 'cName',;
>    Ve.iid;
>    FROM amline!cfiltre cf INNER JOIN amline!Vente Ve ON Ve.iid = cf.itelephoneid ;
>    INNER JOIN amline!Teleph T ON  Ve.itelephoneid = T.iid ;
>    INNER JOIN amline!Resident R ON  T.iid = R.itelephoneid ;
>    IF nOrdre= 1
>     ORDER BY 1 DESC INTO CURSOR cNames
>    ELSE
>     ORDER BY 1 INTO CURSOR cNames
>    ENDIF
>  ENDTEXT
>
>
>
>bernhart
SET TEXTMERGE ON NOSHOW  && YOU CAN LEAVE IT ON
nOrdre = 1
SET TEXTMERGE TO MEMVAR lcSql
\SELECT  LEFT( T.cnomteleph , 20 )  + ' - F.' + TRANSFORM( Ve.cnofact , "99999999" ) AS 'cName',;
\   Ve.iid;
\   FROM amline!cfiltre cf INNER JOIN amline!Vente Ve ON Ve.iid = cf.itelephoneid ;
\   INNER JOIN amline!Teleph T ON  Ve.itelephoneid = T.iid ;
\   INNER JOIN amline!Resident R ON  T.iid = R.itelephoneid ;
IF nOrdre= 1
\   ORDER BY 1 DESC INTO CURSOR cNames
ELSE
\   ORDER BY 1 INTO CURSOR cNames
ENDIF
SET TEXTMERGE TO  && this write the TEXTMERGE buffer into the variable
and this is 50/60% faster

But next is 120/150% faster
SET TEXTMERGE OFF NOSHOW
nOrdre = 1
SET TEXTMERGE TO MEMVAR lcSql
	\ SELECT  LEFT( T.cnomteleph , 20 )  + ' - F.' + TRANSFORM( Ve.cnofact , "99999999" ) AS 'cName',;
	\  Ve.iid;
	\   FROM amline!cfiltre cf INNER JOIN amline!Vente Ve ON Ve.iid = cf.itelephoneid ;
	\   INNER JOIN amline!Teleph T ON  Ve.itelephoneid = T.iid ;
	\   INNER JOIN amline!Resident R ON  T.iid = R.itelephoneid ;
	IF nOrdre= 1
	\   ORDER BY 1 DESC INTO CURSOR cNames
	ELSE
	\   ORDER BY 1 INTO CURSOR cNames
	ENDIF
SET TEXTMERGE TO
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform