Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FUNCTION...ENDFUNC in a class.
Message
 
To
13/04/1998 10:14:14
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00090807
Message ID:
00091548
Views:
18
>>>My thinking has been that isolated functions that don't refer to other globals, properties, etc. might as well go into a procedure library.
>>>
>>>Peter Robinson
>
>>The main CW is that a custom object with custom PEMs is OO and a procedure library via SET PROC TO is not.
>(Colin Magee)
>
>
>Well, yes, it's not OO, but I'm still asking which is the best approach. Let me give you an example. Paul Vlad Tatavu has contributed the following function to the KB:
>
> function WeekLastDay(tdDate)
> return tdDate-Dow(tdDate)+7
>
>Now, I would like to have this function handy to use. Should I create
>some kind of date class to contain this and other methods or just
>put in a procedure library? My inclination is to do the latter.
>
>Or looking at it from a different point of view: VFP has gazillions of functions. Is this a problem that they are not methods?
>
>Peter Robinson

IMO, from the point of view of functionality, niether approach is better than the other. I personally prefer to keep as many things as possible in an app OO so I would most likely, in the case of your example, take that function and create a custom method in my 'procedure library' class. That said however, I would like to get input from others if one has an advantage over the other in relation to speed or other issues.
Colin Magee
Team Leader, Systems Development
Metroland Media Group Ltd.
Mississauga, Ontario, Canada

cmagee@metroland.com

Never mistake having a career with having a life.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform