Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I delete a record from a dat file [not just set it to blank

Status
Not open for further replies.

DarkMercenary44

Technical User
May 19, 2000
55
US
I've got a list box that updates itself from a dat file, the problem I run into is that if I make lets say five entrys, then want to delete like the 3rd one, how do I completely delete the last record in the file [cause I'll be moving all records up one to account for the deletion] Right now if I delete a record the list box updates with a blank list item, anyone know away to do this.

The only way I see to do this is to change the name on the orginal dat file, and create a new one reading record for record form old to new and skipping the record that needs to be deleted, but if you have a huge list then that could take forever. DarkMercenary
darkmercenary44@earthlink.net

In the real world
As in dreams
Nothing is quite
What it seems
:Book of Counted Sorrows
 
If you are using text files, that is the only way to actually delete the space. You could also code in to check to see if there is a blank record and skip it, if it is.
David Paulson


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top