Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deleting records using REPLACE
Message
 
To
24/01/2000 04:50:24
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00321564
Message ID:
00321670
Views:
16
Hi Pascal,

I haven't tested this but I think you should be able to do something like this:

replace myfield with X for delete_it()

* Procedure delete_it
delete
return .T.

>The title says it all ; can I use REPLACE (some systemname) to delete records.
>
>Why ?
>
>I have a candidate index on a table. Records are deleted and added to it (wow !). When a record is deleted and later I want to add a record with the same index, the insert is refused because of the uniqueness constraint (as far as the table hasn't been packed since). So to prevent this, before I delete the record, I change a value in the record (using the negative recno() which can never give duplicates) :
>
>REPLACE whatever_part_of_the_index WITH -recno()
>DELETE NEXT 1
>
>So twice access to the table : can I reduce the access to only once ?
kenweber
GCom2 Solutions
Microsoft Certified Professional

Previous
Reply
Map
View

Click here to load this message in the networking platform