This content has been marked as final. Show 4 replies
Could it be that your fileio operations in your saveDatabase handler aren't clearing the remainder contents of the file before writing? I don't use fileIO a lot, but I remember when I did that there was an issue if you re-write a file with a shorter string than the original, the remainder portion of the original file remains at the end. I beleive I had to actually delete the file before creating and re-writing a shorter amount of data into it to solve the problem.
hope this helps!
Thanks for this Ben. Deleting the file before saving to it works well.
Now I have one more problem: why can't I delete the first record? I feel as if there are some real errors in my code.
So far .... this code will (should?) allow a user to register with 4 fields and login searching for 2 of them. And an administrator to browse, search and edit the data. And the program automatically saves it all to an external text file, and keeps that file updated all the time.
It will get worse:
In the finished program I want this data linked to a list of movies that a user has visited ... and then also to record their results in tests that they do.
When the program doesn't delete the first record, it doesn't give me any error message. The reason it moves to the previous record is because if it doesn't move away from this record, then it will save it again when the user leaves it in whatever way (ie going 'next' or 'home' .... all designed to save what is on screen .. even blank fields will be saved)
When it is not deleted it doesn't show an error. It looks like it is gone, because the screen shows the previous record, (which, if it is the first record, will be the last record, because it loops - I think you're right the problem is here somehow?) But when I hit the next button, it is still there. For all the other records other than No 1, it works very well, they are really wiped from the list.
thanks for your interest, I hope you can help.
this is an English literacy program ... some of which can be seen at: