Private
The Private statement declares a class method or variable as only
accessible within the class. The opposite of Public which
declares a variable available within and outside of the class,
Private may only be used within a Class .. End Class
block.
You should use the Private statement to declare all of
your member variables that you wish to control the values for or
that are only useful within the class. Use Private as much
as possible to abstract the data from the object.
Class Person ' demonstrates how you can control access to a private variable
Private m_nAge ' age of the person
Property Get Age() Age = m_nAge End Property
Property Let Age(nAge) If nAge >= 0 And nAge < 120 Then m_nAge = nAge End Property End Class
|
 |

|