Hi Mike,
Imagine this scenario:

USE AA IN 0
USE BB IN 0
USE CC IN 0
Select AA
&& do something unsuccessful in that table:
LOCATE FOR AA.Field1 = "Nonsense"
&& Now your replace:
REPLACE BB.Field1 WITH CC.Field2

This Replace will not happen, since the working alias of the Replace is AA 
(which is on EOF), regardless which fields (or field aliases) are used in the 
fields list.  Additionally the FOR and WHILE conditions are by default equated 
against the current alias. 
Therefor it's considered good practice to always add the IN clause if in doubt, 
so that the working alias is temporarily set to the desired alias.

wOOdy


-----Ursprüngliche Nachricht-----
Von: ProFox <[email protected]> Im Auftrag von MB Software Solutions, LLC
Gesendet: Mittwoch, 2. Oktober 2019 20:14
An: [email protected]
Betreff: Bad style, but any chance it would ever fail to update properly?

We've seen this before (and I did it 2 decades ago):  REPLACE MyTable.MyField 
with SomeOtherTable.SomeField

The implication is that "replace the MyField value in the MyTable table."  But 
if one doesn't use the IN clause, will there ever be any chance that the update 
to MyTable.MyField would fail?

tia,
--Mike



---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: 
https://leafe.com/archives/byMID/[email protected]
** 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