Multiverse
New Member
- Joined
- Nov 15, 2019
- Messages
- 16
Hi All
I have a really strange behaviour going on with a Class. I have a variable of type double which I can access either through property get, or public function. When using the class from one module, the variable is retrieved as expected, but when using the class from another module, I get 0 returned.
So using the debugger, and looking at the property get (or the function), when I hover over the variable, the value is zero. Not what I expected, so I inspect in the locals window and find it has the value of 1 as expected. Now when I go back to the property get, doing nothing else but hover over the variable, the variable has changed value from 0 to 1. I'm totally puzzled as to why my code is struggling to return the value of the variable and why the value of the variable changes when I observe it's value in the locals window. And I also find it weird that in a different Module, the Class behaves as expected.
Any ideas?
I have a really strange behaviour going on with a Class. I have a variable of type double which I can access either through property get, or public function. When using the class from one module, the variable is retrieved as expected, but when using the class from another module, I get 0 returned.
So using the debugger, and looking at the property get (or the function), when I hover over the variable, the value is zero. Not what I expected, so I inspect in the locals window and find it has the value of 1 as expected. Now when I go back to the property get, doing nothing else but hover over the variable, the variable has changed value from 0 to 1. I'm totally puzzled as to why my code is struggling to return the value of the variable and why the value of the variable changes when I observe it's value in the locals window. And I also find it weird that in a different Module, the Class behaves as expected.
Any ideas?
VBA Code:
CLASS
Private cConsultant1TotalPercent As Double
Private cTotal5000to5020 As Double
Public Property Get Consultant1Fee() As Double
Consultant1Fee = Round(cConsultant1TotalPercent * cTotal5000to5020, 2)
End Property
VBA Code:
MODULE
myOutputArray(i, 4) = myColl(n).Consultant1Fee