1.

What Are Class Properties?

Answer»

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:

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

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:

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



Discussion

No Comment Found