Boy! For any of you Lucky Stiffs out there that have PB9 already (I've ordered mine, but don't have it yet), and are looking to learn all the new OOP capabilities by starting with something concrete but relatively easy, dates would be an excellent place to start!
Here a few weeks ago I was doing some substantial modifications to one of my organization's main programs, and the realization hit me that I had the thing laced with various date routines that operated on various date TYPEs, some of my own making, and some like the TIME_STAMP structure in ODBC. What an excellent example of combining code and data into an encapsulated class!
For example, sometimes you have strings such as 11/15/1952 that need to be converted into something like this for import into a database "#11/15/1952#", or like this for a report - Saturday, November 15, 1952, so on and so forth. Would be really cool to just instantiate a local date variable, load it with a couple properties, then be able to extract info out of it with just simple obj.property syntax instead of setting up a function, having to hunt for it in one's code, etc!
Here a few weeks ago I was doing some substantial modifications to one of my organization's main programs, and the realization hit me that I had the thing laced with various date routines that operated on various date TYPEs, some of my own making, and some like the TIME_STAMP structure in ODBC. What an excellent example of combining code and data into an encapsulated class!
For example, sometimes you have strings such as 11/15/1952 that need to be converted into something like this for import into a database "#11/15/1952#", or like this for a report - Saturday, November 15, 1952, so on and so forth. Would be really cool to just instantiate a local date variable, load it with a couple properties, then be able to extract info out of it with just simple obj.property syntax instead of setting up a function, having to hunt for it in one's code, etc!
Comment