Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Destroying an object
Message
From
28/08/1997 16:18:48
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00046886
Message ID:
00047429
Views:
31
Hello Darrel, the way MS set this up is somewhat confusing, but it is not too complicated all the code that the VFP base classes have in Events and Methods (the one written in C) if this wasn't like that you would have situations like : putting some code in the click event of command button would have prevented the command button from being visually "Clicked", putting code in the Keypress would have prevented the key from being processed etc. you can prevent this with NODEFAULT however when it comes to code the developer puts in the Events and methods it does over-write previous code here the logic is that if you decide to over-write code you don't want the original code to execute if you write some code and do want to execute the over-written code , you can do so with DoDefault or using the scope resolution (::) for the method/event Arnon >>> > >Oh, now I understand. This is getting ridiculous. If the event method is >called manually the base class method is not called automatically, but if >that same event method is called by an event the base class event method is >called automatically. I guess this is justification enough never to call an >event method directly! > >I would have much prefered if MS had told us that if we were going to >override an event we had to place a DoDefault() at the end of our code so >that at least the behaviour of a base class would be consistent with that >of a subclass. They could even autoinsert the DoDefault() into any event >method as the do with methods that have parameters. > >Thanks, >Darrel >
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform