I can probably count on both hands and feet the number of times I have literally sworn at Visual FoxPro (that would make it an average of once a year). Today was one of those days. I have been working on a new solution for one of my customers that needs to send email. I have tried several techniques with emailing from FoxPro over the years (Outlook Automation, CDO, West Wind wwIPStuff, Shelling out a MailTo, and most recently Craig Boyd’s Extended MAPI FLL, and Blat). The swearing has nothing to do with any of the email techniques, but I can say working with email does cause hair loss.
The situation that caused me to swear today was one I have never seen before, and honestly cannot explain how it happened. I was working with a set of classes. One parent class (abstract) and four different subclasses with all the different implementation scenarios. I was using the Class Browser to work with the class library. I instantiated the child class like normal using a NEWOBJECT(), and then called the SelfTest method I have setup to run through different test scenarios I have to verify the code works as designed. I found the problem I was tracking down in the debugger, canceled out, and opened up the subclass.
This is when the twilight zone moment happened. When I opened the class all the source code for the class was gone. I mean gone, as in zero property settings, and no method code. I closed the class and opened it again. Same thing. Holy S&^*&&*t! (sorry, but I have to tell the whole story). A complete morning’s worth of stream of conscious coding out the window. I tried to open up the parent class and got the message that the class was in use. Weird.
CLOSE ALL
CLEAR ALL
RELEASE ALL
CLEAR PROGRAM
ox=.NULL.
RELEASE ALL
*{pray}
Yes, I know the commands have some redundancy, but one can never be to sure to get the cleanest environment. Back to the Class Browser and still no luck opening the parent class: still in use. Visual FoxPro has a way to hold on to classes when I least want it to. Time for the FoxPro flush (not the FLUSH command, rather, QUIT and restart). Opened up the Class Browser and my subclass and there it is in all it’s glory, the source code for methods and properties are back to normal. Relief.
So I backed up the class library and finished up the documentation in the classes and called it a morning. Hopefully the stress of potentially losing the source code made me stronger since it did not kill me (this time at least).





