COMPUTER LANGUAGES HTML,C,C++.JAVA,.NET AND MULTIMEDIA basics and programs click home button
ADVANCE VB SCRIPT CLASS PROPERTIES
Class Properties
Class properties, such as Property Let, which handles the process
of data validation and assigning the new value to the private variable.
Property set, which assigns the new property value to the private
object variable.
Read-only properties have only a Property Get procedure while
write-only properties (which are rare) have only a Property
Let or a Property Set procedure.
Example
In the below example, we are using Properties to wrap private variables.
Class Comp
Private modStrType
Private OS
Public Property Let ComputerType(strType)
modStrType = strType
End Property
Public Property Get ComputerType()
ComputerType = modStrType
End Property
Public Property Set OperatingSystem(oObj)
Set OS = oObj
End Property
Public Property Get OperatingSystem()
Set OperatingSystem = OS
End Property
End Class
No comments:
Post a Comment