Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy to Delim
Message
From
07/03/2000 22:23:57
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00337856
Message ID:
00343101
Views:
29
> I'm looking at textmerge from the Hackers Guide for VFP6. Before I stumble too far down this path (tryiing to use textmerge),
> am I walking in the right direction? or should I turn around and go somewhere else?

Textmerge is used to stream text to a file, its more or less like you've redirected your standard output to a file--except that you can do substitutions using this syntax: <<VFPCode>>

Now if the text in the memo field is already how you want, you might consider looking at ALINES() it takes the content of a memo field, and places each line into an element of an array. You could then loop through the array, and then TEXTMERGE the contents of the array:
SET TEXTMERGE TO somefile.txt
SET TEXTMERGE ON
FOR x = 1 TO ALEN(laLines,1)
  \&lt;&lt;laLines[x]&gt;&gt;
ENDFOR
SET TEXTMERGE OFF
SET TEXTMERGE TO
alternatively, you could do something like:
lcLine = "\"+laLines[x]
&laLines
to get the format right.

One thing, ALINES() relies on there being CHR(13) or CHR(10) at the end of the line. Also, if you have only a single record's worth of data in each memo field per record, then you could probably just put the memo field name where the laLines[x] is in the code above. Watch spacing in textmerge, it will dump what you put there, so if you have a space between the "\" and the text, it will be included, etc.

HTH,
Bill
Previous
Reply
Map
View

Click here to load this message in the networking platform