Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Replace or Update
Message
From
18/06/2019 02:18:43
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01669142
Message ID:
01669147
Views:
71
>>Hello friends, REPLACE or UPDATE. Which one should I use? Why?
>
>What is the exact intention and what do you want to do? I think both should work fine but REPLACE command moves record pointer and UPDATE doesn't.
Misleading answer - Replace does NOT move record pointer if written without defining the scope of records (ALL/FOR/REST)
CREATE CURSOR t1 (F1 I, F2 I, F3 I)
APPEND BLANK
APPEND BLANK
APPEND BLANK
GO top
REPLACE f1 WITH RECNO()
REPLACE f2 WITH RECNO()
BROWSE
Use Replace for all changes of a single record in place, use update for all changes involving potentially more than current record (unless REST handling makes sense, which it sometimes does...)
Previous
Reply
Map
View

Click here to load this message in the networking platform