I'll have to try this again. I thought I found varchar fields were
right-padded in the DataToClip function, but perhaps I messed up the
testing.


On Fri, Jul 17, 2015 at 5:50 AM, Laurie Alvey <[email protected]> wrote:
> When I posted the CTOV function, you quite rightly pointed out that it
> wouldn't solve the DataToClip problem. I meant to say the code should look
> something like this:
> SELECT something FROM somewhere INTO CURSOR somecursor
> CTOV(somecursor)
> _VFP.DataToClip(somecursor,3)
>
> Laurie
>
> On 16 July 2015 at 15:16, Ted Roche <[email protected]> wrote:
>
>> Very good! I hadn't tested the code; it worked fine in an email message
>> <g>.
>>
>> On Thu, Jul 16, 2015 at 8:47 AM, Laurie Alvey <[email protected]> wrote:
>> > Hi Ted,
>> > I modified your macro code to get it to work to this:
>> > lcCmd = "REPLACE ALL "
>> > FOR i = 1 TO n
>> > IF laCols[i,2] == "V"
>> > lcFld = laCols[i,1]
>> > lcCmd = lcCmd + lcFld + " WITH ALLTRIM(" + lcFld + "),"
>> > ENDIF
>> > ENDFOR
>> > IF LEN(lcCmd) > LEN("REPLACE ALL ")
>> > lcCmd = LEFT(lcCmd, LEN(lcCmd)-1)
>> > &lcCmd
>> > ENDIF
>> >
>> > I did some testing with a table of 10000 records of 12 columns (10 of
>> them
>> > V(10)). These are the results:
>> > My raw function 912 ms
>> > Macro REPLACE 110 ms
>> > Macro SQL UPDATE 187 ms
>> >
>> > Thanks for the suggestion.
>> >
>> > Laurie
>> >
>> > On 16 July 2015 at 09:39, Laurie Alvey <[email protected]> wrote:
>> >
>> >> Thanks Ted, although I don't like macros, I'll give it a try.
>> >>
>> >> Laurie
>> >>
>> >> On 15 July 2015 at 21:09, Ted Roche <[email protected]> wrote:
>> >>
>> >>> On Wed, Jul 15, 2015 at 2:54 PM, Darren <[email protected]> wrote:
>> >>> > Ted,
>> >>> >
>> >>> > This works ok for me here (haven't you heard that before)
>> >>>
>> >>> Oh, I think I've said that this morning!
>> >>>
>> >>> >
>> >>> > SELECT cCursor
>> >>> > COPY TO cTempFile DELIMITED WITH TAB
>> >>> > _CLIPTEXT = FILETOSTR(cTempFile)
>> >>> >
>> >>> > Paste the clipboard to Excel
>> >>> > Delete the temp file.
>> >>> >
>> >>> > Cheers
>> >>> >
>> >>> > Darren
>> >>>
>> >>> Cheers!
>> >>>
>> >>> A wise man (or perhaps it was a wise guy) once said, "There are three
>> >>> ways to do anything in FoxPro, or there's no way at all." I'm going to
>> >>> have to try this one out.
>> >>>
>> >>> And... that works! Sunuvagun. COPY TO has an implicit RTRIM() in it,
>> >>> which solves the same problem, the other way round. Very good!
>> >>>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/CACW6n4u98SQv5bFykPsAx2qmNyR=nbkvhp0vs+z47vfe4e0...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to