I have a class for a cylinder and i want the user to have the option not only to read the volume of the cylinder but to write the volume and preserve the height, radius or proportion by user's choice. I'm with this code for that condition:
But when i try to compile i get the error:
Definitions of property procedures for the same property are inconsistent, or property procedure has an optional parameter, a ParamArray, or an invalid Set final parameter
Anyone knows what should I do?
Code:
Public Enum PreserveRelationType
PreserveRadius = 0
PreserveHeight = 1
PreserveProportion = 2
End Enum
Public Property Get Volume() As Double
TotalSurface = AreaOfCircle(Radius) * p_Vector.Module
End Property
Public Property Let Volume(Optional Preserving As PreserveRelationType = 2, Value As Double)
Select Case Preserving
Case 0
p_Vector.Module = 2
Case 1
Case 2
End Select
End Property
But when i try to compile i get the error:
Definitions of property procedures for the same property are inconsistent, or property procedure has an optional parameter, a ParamArray, or an invalid Set final parameter
Anyone knows what should I do?