General information
Category:
Forms & Form designer
Ken,
Thanks for the reply. Is there any difference between your method and doing something like this in the method.
MyForm.Init
DO SomePreStuff()
...
DoDefault()
DO SomePostStuff()
...
Thanks
>John,
>
>As opposed to Sylvain's method, I do not like imbedded returns in most cases. I am of the school that methods/prgs/etc should have "one way in and one way out". with that in mind, I use something like:
>
>*-----------------------------------
>local lbOK
>lbOk = .F.
>
>if PreHook()
> lbOK = DoStuff()
> = PostHook()
>endif
>
>return lbOK
>*-----------------------------------
>
>If you need a DoDefault() or to die if the PostHook fails (I usually don't), that can be easily implemented.
>
>Ken
>
>
>
>>Ken,
>>
>>Thanks for some things to ponder about... BTW, how do you "Kill" the method if you return a .F.?
>>
>>Thanks
>>
>>>John,
>>>
>>>I have hooks everywhere in my framework. I love 'em. I do agree with Jim B. in that I ALWAYS do a DdDefault() whenever I write code in a VFP base method.
>>>
>>>The key to hooks is consistent naming and placement. for example - most of my pertinent methods/events have PreMethod and PostMethod hooks. PreMethod hooks can always "kill" the method/event if they return .F.. On occasion, I will also have specific named hooks for special needs. I always make sure to name them SomthingHook().
>>>
>>>Ken
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only