I'm currently encountering a really evil error in VFP 9 SP2.
I created some forms and classes and my program runs just fine. Out of nothing the program is crashing and won't respond to anything, the only way to close it is via taskmanager.
I looked through all my code and found nothing but then I accidentally added a plain commandbutton to a container in my class (maybe it was just the right container ^^ ) and it worked fine!
But there's no place for this button and I wanted to get rid of it and everytime I tried to delete it, my program crashes again. I searched in my whole project with "go fish" multiple times - nothing!
Then I opened the .vct and found a line which seemed to had no reference and is never used in this class. I interprete this as an error from Foxpro, maybe a rest of code that hasn't been deleted the way it should. When I tried to delete it, my whole classlib has been destroyed.
If I try to set the .Visible-Property in my button to .f., the result will be the same - a crash.
So somehow I have to get rid of it. The class is too big to rewrite it.
I would be glad if you'd any suggestions on how to solve the problem.
The kind of crash you describe generally indicates some kind of corruption either in a table or an index. Couple of things you might try:
1) Make a backup of the form, then USE it and PACK.
2) USE the form and copy it to a new file. Then rename the original and then the copy and see whether the new copy is better behaved.
Tamar