Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deleted records
Message
From
25/01/2003 17:07:26
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
25/01/2003 16:27:18
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00745433
Message ID:
00745456
Views:
17
>Dennis,
>
>There is no way to physically remove them, besides performing a pack, or copying the records to a new table. Physically removing records every time one is deleted would be a very inefficient operation...in reality it would require rewriting all records after the delete point.

I don't agree that it would "require rewriting all records after the delete point", not for fixed-sized records. Say you have 1000 records, and you want to delete record #500. It would be possible to copy record #1000 to position #500, and then adjust both the file size and the reccount() part of the header.

Note that a) This wouldn't work for memo fields, and b) Users are accustomed to have the possibility of seeing records in the order they were created. This wouldn't be possible with the above algorithm. And of course, you could no longer use recno() as the primary key (which isn't recommended anyway).

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform