Hm, interesting. If I were doing that in VBA I suppose I'd have to have a property I called Name that would have the dog's name, and a constant set to "canis familiaris". Or, no, wait, VBA doesn't allow a class to have a public constant, so it would have to be a Property Get, I suppose.
--- Bob Bridges, [email protected], cell 336 382-7313 /* Civilization advances by extending the number of important operations which we can perform without thinking about them. -Alfred Whitehead, "An Introduction to Mathematics" */ -----Original Message----- From: IBM Mainframe Discussion List <[email protected]> On Behalf Of Charles Mills Sent: Wednesday, January 5, 2022 15:57 Classes have "static methods" that are generic and pretty much always available, and "instance methods" that apply to a particular instance of a class. If you had a class that represented a dog you might have a static method "what species are you?" that would always return "Canis familiaris." On the other hand a method "what is your name?" would have to be an instance method. A particular instance or example of a dog has a name; asking dogs in general "what is your name?" would be meaningless. You could always ask the dog class what its species was, but to ask for a name you would need to have a particular dog (an instance of the dog class) to ask. -----Original Message----- From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of Bob Bridges Sent: Wednesday, January 5, 2022 12:10 PM Yeah, so maybe it wasn't a C compiler that I bought. It's been a long time; I'm not sure any longer. And I'm pretty sure that at the time I didn't comprehend what OO programming was about. The descriptions I read, and the examples, didn't seem all that different to me; what's the big deal?, I wondered. But when trying to program in VBA/Excel I kept running into the message "does not support this property or method", which drove me crazy since I'd JUST USED IT OVERE HERE! I didn't understand the difference between a general function and the method of an object, you see. It wasn't until I followed a VBA programmer's advice and tried writing my own class, even though I didn't particularly need one at the moment, that it suddenly became clear. I've been a fan ever since. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
