Accessing Methods and Member Variable Within a Class

There is a problem when it comes to calling methods and accessing member variables within a class. Specifically, what is the name of the object? It is all well and good to require the name of the object when you are dealing with an instantiated object—the program that instantiated the object knows what the name is. Within a class, we have no knowledge of what the object's name is.

The solution is a "generic" name that is assigned to the object when working within the class. The generic name is "This". Thus, if I wanted to call the SHOW method within the class on which oForm was instantiated, I would do it as follows:


this.show()

Similarly, I could access a member variable by using THIS. Note that this only works when you are working within a class.