>>Accordingly how would I set this using your syntax to apply only to the LastFile. I know you had cautioned me once before to use Select 0 but that ship has sailed in this case.
>
>If you have MyVal columns in both NowFile and LastFile, you would need to make sure you reference the one in LastFile by adding its alias:
>
>REPLACE MyVal WITH IIF( LastFile.MyVal < 7, INT( LastFile.MyVal ), LastFile.MyVal ) IN LastFile
>
>That should work regardless of which work area is currently selected, and whether it contains an open table or not.
Exception:
The current work area is on EOF and for all I know on BOF. This will stop
REPLACE ... IN xxx from working.
what is wrong with
IF LastFile.MyVal < 7 THEN
lnOldSel = SELECTED()
SELECT LastFile
REPLACE MyVal WITH INT( MyVal )
SELECT (lnOldSel)
endif
?
It's a bit more code, but there is no added problem with
IN clause, no problems with
GETFLDSTATE fileds from wrong table and so on.
The other solution is SQL UPDATE, but this needs some PK on LastFile. And I'm not shure if a several thousend lines UPDATE is faster then a REPLACE with some wrapping.
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord
Weeks of programming can save you hours of planning.
OffThere is no place like [::1]