B
Bernard Bourée
I have the following code:
Dim mVar As New Variable()
mVar.NomVal = "Test" ==> this line return a NomVal ="Test"
mVar.oVal = 10D ====> but this one return a oVal= NOTHING !!!!
What is wrong ?
Bernard
----------------------------------
Public Class Variable
Private mNomVal As String
Private moVal As Object
Public Property NomVal()
Get
Return mNomVal
End Get
Set(ByVal Value)
mNomVal = Value
End Set
End Property
Public Property oVal() As Object
Get
Return oVal
End Get
Set(ByVal Value As Object)
If TypeOf Value Is Integer Then
moVal = CType(Value, Integer)
ElseIf TypeOf Value Is Short Then
moVal = CType(Value, Short)
ElseIf TypeOf Value Is Long Then
moVal = CType(Value, Long)
ElseIf TypeOf Value Is Decimal Then
moVal = CType(Value, Decimal)
ElseIf TypeOf Value Is Double Then
moVal = CType(Value, Double)
ElseIf TypeOf Value Is Boolean Then
moVal = CType(Value, Boolean)
End If
End Set
End Property
Dim mVar As New Variable()
mVar.NomVal = "Test" ==> this line return a NomVal ="Test"
mVar.oVal = 10D ====> but this one return a oVal= NOTHING !!!!
What is wrong ?
Bernard
----------------------------------
Public Class Variable
Private mNomVal As String
Private moVal As Object
Public Property NomVal()
Get
Return mNomVal
End Get
Set(ByVal Value)
mNomVal = Value
End Set
End Property
Public Property oVal() As Object
Get
Return oVal
End Get
Set(ByVal Value As Object)
If TypeOf Value Is Integer Then
moVal = CType(Value, Integer)
ElseIf TypeOf Value Is Short Then
moVal = CType(Value, Short)
ElseIf TypeOf Value Is Long Then
moVal = CType(Value, Long)
ElseIf TypeOf Value Is Decimal Then
moVal = CType(Value, Decimal)
ElseIf TypeOf Value Is Double Then
moVal = CType(Value, Double)
ElseIf TypeOf Value Is Boolean Then
moVal = CType(Value, Boolean)
End If
End Set
End Property