Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How disappointed I am .
Message
From
07/02/2002 10:02:29
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
07/02/2002 07:42:05
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00615259
Message ID:
00616599
Views:
21
>Hi Dragan
>
>>> A subclass can have new properties and methods that its parent class doesn't;
>
>Exactly. But the addition of such methods and properties is a design time issue and requires amendment of the sub class definition.
>
>>> the trouble here is that the addmethod()
>
>I'm sorry, I missed the beginning of this thread, what is AddMethod()? I know of AddProperty() (which is intended to provide a solution to the problem of creating parameter objects at run time without needing to pre-define a class for every possible combination of properties. But that is an entirely different issue).

AddMethod() (or lack thereof until VFP7) is what brought me here. I was writing a converter for scx files, and there was no way to programmatically add a method to a form/class being edited, while the functionality does exist in the menu (the new method dialogue, callable from menu). I was looking for a solution for that, and found UT instead, april 1997.

WriteMethod(cMethodName, cMethodText, lAddIfNotThereAlready) has this new third parameter in VFP7 which can add a method to an object retrieved via aSelObj() if it didn't exist. The trouble is that it can add it to a member object as well, but the code disappears after a save. So eventually it turns out right, but it shouldn't even allow you to add a new method to a member object.

Someone here did come up with an ingenious workaround for this third parameter which works in VFP6 (and probably 5 as well):
oSelobj.addproperty(cMethodName)
oSelobj.writemethod(cMethodName, cMethodText)
save the form/class

I tried it and it worked, but too late - just a few weeks later VFP7 was published with a direct solution.

back to same old

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

Click here to load this message in the networking platform