>>Has anyone else run into a problem where, upon saving changes to a form, method code mysteriously gets swapped to other methods? For example, all of the code from the form's INIT method moves to the REFRESH method, and vice-versa. This happened to me before on a particular app I wrote in VFP5, and then it just happened to me again today on a completely different VFP 6 app. (I do have SP3 loaded.) I can't figure out what makes it happen, because it doesn't happen every time. When it happens though, it swaps code from several methods, but not all of them. It happens to object methods and form methods. The only thing similar about these two apps is that they both use a pageframe. Finally, I will add that in thinking it was related to my custom class library, I did some testing using only the VFP foundation classes, and the problem still happened.
>>
>>Any ideas?
>
>I had this problem only with Dataenvironment.BeforeOpenTables and AfterCloseTables methods in VFP 5, but it is a known bug.
>
>Nick
BTW, the funny workaround for this case is to place the same piece of code in both methods which does conditional executing after checking the PROGRAM() function:
*** in both BeforeOpenTables and AfterCloseTables methods
IF "BEFOREOPENTABLES" $ PROGRAM()
* BeforeOpenTables code here...
ELSE
* AfterCloseTables code here...
ENDIF
Nick
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro
"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison