Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subclass method disappears when parent method name chang
Message
From
21/10/1998 14:51:41
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00148378
Message ID:
00149034
Views:
15
>Try this, just to see if I'm losing my marbles:
>
>1. Open a parent class and add a method. Just call the method asdf and put a single * in for its code. Close the class.
>
>2. Open a child of that parent and put a single * in for asdf's code. Close the class.
>
>3. Open the parent class and rename the method via the Edit Property/Method dialog. Close the class.
>
>4. Open the child class. The asdf method has disappeared.
>
>The code is actually still in the VCX, as Scctext shows. But it's inaccessible through ordinary means.
>
>If my test isn't just some sort of weird fluke, this means that extreme caution is required when changing a method name!

That's what I supposed would happen when we discussed this couple of days ago. Now take an additional step:

Use the .vcx where the child class resides, find the child class record, and add a line in Reserved3 with "*asdf"+chr(32)+chr(13). Now close the .vcx, and recompile it. Modi Class ChildOf. The code for asdf method should reappear.

What happens: while there was an asdf method in the parent class, it was existing by default for the child class, therefore it wasn't registered as a custom method in the child class. Now when it doesn't exist in the parent class, it became a custom method in the child class, which doesn't have it registered yet (it would have, if it was regularly added via Class/New method), so we have to get involved with Reserved3 to register it. It's a kludge, but it fixes the misbehavior of creating orphan methods.

Just like with any other name change, the renamer has yet to remember all the places where the name was already used, and be ready for surprises :)

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform