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/camvtr9ffdtsyoagritg82eyutjxg3qune6jw-x2hk_9g8aw...@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