Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Age Calculation
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00403635
Message ID:
00404336
Views:
11
>I wrote AGE.PRG as a UDF back in the days of FoxPro 2.x. It's kind of awkward to return three values from a UDF, so I've been thinking about making an object out of it, with a Calculate method and three return-value methods (GetYears, GetMonths, and GetDays). That way it would be easier to request the result(s) one wants instead of having to parse a string. What do you think of the idea, and would this be of any value to you? If I know somebody else wants it, it'll probably prod me into doing it < g >.

Hi Rick,

Why not just return a string (YYYMMDD)?

And if going the OOP route, why not make years, months, and days properties of the object?

o = createobject("age")
o.dob = ctod("9/15/64")
o.calculate()
? o.years
? o.months
? o.days

Instead of calling three methods just call one.

Alex
Low-carb diet not working? Try the Low-food diet instead!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform