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

 

 

 

 

 

 

 

 

 

 

 

 

Property Get

The Property Get statement declares a property for an object within a Class definition. It allows the person who creates an instance of the class to retrieve a property of the class.

You should use Property Get as opposed to Public member variables wherever possible. This is just a good rule-of-thumb when creating objects since it abstracts the data from the object. If you decide later that you want to put tighter controls on the member variable, you will be glad that you used a property because you won't have to change the interface to 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



"I only regret that I have one life to lose for my country." - Nathan Hale

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