Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using TEXT - ENDTEXT
Message
 
 
To
06/01/2009 14:35:02
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01371436
Message ID:
01371471
Views:
19
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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform