Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using TEXT - ENDTEXT
Message
 
 
À
06/01/2009 14:35:02
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01371436
Message ID:
01371471
Vues:
22
Below are different options ordered by efficiency. I always start at the top and go down, if necessary

1. Name expression
2. Macro substitution
3. EXESCRIPT()

>Thanks Sergey, that's much cleaner than my attempt. Curious about something else now. You used macro expansion rather than EXESCRIPT. Any reason to prefer one over the other?
>
>>VFP9 has PRETEXT 8 value that eliminate new line characters. In VFP8 you'll have to use CHRTRAN().
>>
>>lcQtyFields = ""
>>
>>FOR I = 1 TO 10
>>TEXT TO lcQtyFields NOSHOW TEXTMERGE ADDITIVE
>>,QTY<<I>> int
>>ENDTEXT
>>ENDFOR
>>
>>TEXT TO lcTry2 NOSHOW TEXTMERGE PRETEXT 1+2+4
>>CREATE CURSOR output (
>>   F2 C(<<LEN(pop.f2)>>),
>>   CITY C(<<LEN(pop.city)>>)
>>   <<lcQtyFields>>)
>>ENDTEXT
>>
>>
>>lcTry2  = CHRTRAN(lcTry2,CHR(13)+CHR(10),"")
>>&lcTry2 
>>
>>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform