Stuart McLachlan
stuart at lexacorp.com.pg
Fri Apr 15 17:33:59 CDT 2011
Sorry, I can't agree with you there. A METHOD is a function. A PROPERTY is the external name given to a variable which is encapsulated in the class. i.e. for all intents and purposes outside of the object, it IS the variable. "PROPERTY SET" and "PROPERTY GET" are methods. The fact that you can also perform other actions when you SET a variable is irrelevant. You should be doing what it is saying and setting the value of the variable. When you GET it, you should be retrieving the value of the variable. Wiile it is possible to create SET/GET functions for a property so that GET doesn't return what is SET, it is a gross abuse of the whole Object concept. > > A property is a function. It happens to be targeted to wrapping > variables and exposing them to the outside world but that is not all > it can do. A property does not *define* the variable, that is done in > the dimension statement. A property does not "own" the variable that > it wraps, it is simply *returning* the variable. A property does not > have any data storage area on the heap unless it happens to dimension > its own variables inside of the property, and even then (except for > strings and statics) most variables inside of functions are stored on > the stack. > > A variable, whether global or private is nothing more than a reserved > area of memory on the heap sized to accept a specific data type. >