Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The most elegant and readable way (and efficient)
Message
From
10/12/2005 09:09:49
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01076714
Message ID:
01076866
Views:
17
Hi,

Sergey's way is probably efficient enough, but on the asssumption that oodles
of records might have to be modified, I'ld prepare a replace-string
pseudo code
for every field in both tables and not in exclude list
   tcRep = iif(empty(tcRep), "" ,tcRep + ", ") + fieldname + " with iif(empty(target.fieldname) and !empty(source.fieldname), source.fieldname,  target.fieldname)"
and later call
replace all &tcRep for seek(target.PK, SourceAlias, SourceTag)

which makes just one call to makroexpansion for the whole table.
Since the whole processing of empty fields is handed off to the runtime,
it should be faster than checking in a vfp loop after positioning via code.

Also, it is immune against tables with different fcount() and so on -
but requires same field names and is a bit more work. depends on your data <g>.



my 0.02 EUR

thomas
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform