Home  |  Latest News  |  Contribute  |  F.A.Q.  |  Account  |  Scripts | About
Search ASPNut:
 
ASP Reference
Server Variables
ASP Glossary
Related Sites

Free Components

HTML Reference
Web Colors
Entities
CSS Level 1
Encode/Decode
Glossary

Our Sponsors
ASP Nuke CMS
Free Auctions
PHP 5 Script
Funktastic Blog
ULost Directory
Team Task

 

 

 

 

 

 

 

 

 

 

 

 

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

Orvado Technologies

ASP Nuke CMS
Free Open Source
Content Manager
HomeFix Boards
Home Remodeling
Message Boards

Contact Us | Contribute | About | Site Map



"All programmers are playwrights and all computers are lousy actors." - Anon

©2007 Orvado Technologies, All Rights Reserved
ASP Nut provides articles and reference documentation for Active Server Page developers.