Hi Naomi,
>Anyway, I think gather works quite nice instead of building the replace command (though I considered it as well at first).
I responded to the "efficient" part, since that is mesurable.
For me, abstacting the logic into a string has other "nice" possibilities, for instance easy logging with strtofile(). Elegance is probably largely in the eye of the beholder: Using a scatter - approach I'ld probably just (scetchy pseudo)
scatter name loSource
loEmpty = createobject ("empty")
for lnRun = 1 to aelements(laProp,,,)
if empty and ...
addobject(loEmpty, laProp[m.lnRun], eval(laProp[m.lnRun]))
endif
next
gather name loEmpty
from this already "pruned" object.
This way might actually be slower than Sergey's way, depending on the speed of addproperty in a loop vs. a single gather operation - not tested <g>. But for me the "elegance" would be in the possibility to log ONLY the resulting changes by iterating over all the properties of the previously "empty" object. As I said, in the eye of the beholder <bg>.
regds
thomas