Just when I thought I saw it all...
Using GoFish I was looking for a duplicate of a method, and all the places where it may be called - just housekeeping and cleaning up. In a certain class, it found it in four places:
- honorable mention in Resered3, prefixed with a *, i.e. this is a custom method to this class
- the method itself (in the procedure blabla, which isn't visible in the editor but it's there in the methos memo)
- rightclick in a grid (expected caller)
- click of some button on the page, just below the grid.
Except the button isn't there. Yet GoFish finds it every time. The editor doesn't see it, the aselobj() gives a reference to any of its parents but they don't have it as a member, PEM window doesn't see it, PemEd doesn't see it.
So I went ito GoFish's datasession, opened its cursor for the results grid, and it says this phantom control's recno() is 502. OK... open the classlib as a table, browse - there it is.
Then it dawned on me. How this class came to be. I was reworking a whole series of containers to base them on a different class, to have a different pageframe etc. Depending on how complicated it was, I'd sometimes do a saveAsClass(), repointer the new class to a different parent, rename pages in the properties memo of the pageframe (must do that or all kinds of errors pop up). Sometimes I'd just create a new class and copy-paste objects from the old one, page by page, clone non-default properties of those which existed in both etc. There was even a third method, which I don't quite remember, this is something I do when time permits, which isn't every day.
So what happened? Somewhere along the way I copied something from the old to new, redefined something, and the new properties of the page didn't mention this button. It should have a line containing
TheButton.name="TheButton"
(which is one of those bootstrap pulling definitions, what came first, egg or egg?). That's what Fox uses as a list of members (just having a proper parent reference in the child record isn't enough), and this one was missing on the list. Since I wanted to get rid of the button, I just deleted record 502 in the classlib, recompiled the classlib, done.
If anyone wants to create an orphan object in a vcx/scx, this is one way to do it.