Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Speeding up writing a word document
Message
From
19/07/1999 03:14:28
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
18/07/1999 14:13:06
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00242250
Message ID:
00242990
Views:
22
>>
Application.DataToClip(alias(),reccount(),3)
>>_cliptext = strtran(_cliptext,chr(9)+chr(13),chr(13))
>>_cliptext = strtran(_cliptext,chr(13)+chr(13),chr(13))
>>do while occurs(" "+chr(9),_cliptext)>0
>> _cliptext = strtran(_cliptext," "+chr(9),chr(9))
>>enddo
>
>I've done this for Excel - and discovered that _vfp.datatoclip has its limitations. Not only the padding spaces, but some other things which formatted the data in a way I didn't like, so I wrote something likethis:
>
>#define cTab chr(9)
>#define cr chr(13)
>scan
>   _outtext=_outtext+Trim(field1)+cTab
>   _outtext=_outtext+ctod(datefield)+ctab
>   _outtext=_outtext+mline(memofield,1)+ctab
>   _outtext=_outtext+alltr(str(nField,11,2))+cr
>ends
>_cliptext=_outtext
>[ paste into excel now]
>
>
>
>It works like a charm - all the formatting is done in VFP, and I was actually shocked to understand that VFP has stronger string functions than Word 97 (or Excel, for that matter). I mean, Word should be a text processing oriented tool.
>
>BTW, one thing doesn't work in Excel - I'm writing one column which contains a string, which is used as an index into a lookup table on Sheet2. If this string begins with an alpha char, it works fine; if it contains digits only, the lookup formula returns #N/A. Formatting whole column as text doesn't help. Sometimes pasting the same number from another cell with the same value helps, sometimes it doesn't. Don't have a clue why does it do this.
>
>I've heard there should be some chr(?) to prefix such fields, to have Excel accept them as text containing digits, and not as a number, but wouldn't know which one.
Dragan,
For such situations to be sure I precede them with a '
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform