Still in new year holidays and having nothing to do, I'm trying to understand what Mike Wolfe's trying to achieve in this article:
https://nolongerset.com/a-safer-way-to-use-tempvars/
It seems that he adds a tempvar and then in the class, he sets a property to read the value of a tempvar and then get its value when needed.
It's 3 steps:
1-Adding a tempVar
2- Using Let property in the class to fill the property's value.
3- Using Get Property to read it
What I can't understand is : If there's a class to be used, why using tempvars at all.
Why not simply using the class Let/Get properties without tempvars?
I think the following will do the same, in only 2 step. Setting a value into the property and then reading it when necessary.
Thanks for any insight on this.
https://nolongerset.com/a-safer-way-to-use-tempvars/
It seems that he adds a tempvar and then in the class, he sets a property to read the value of a tempvar and then get its value when needed.
It's 3 steps:
1-Adding a tempVar
2- Using Let property in the class to fill the property's value.
3- Using Get Property to read it
SQL:
Public Property Let MyVar(Value As Currency)
TempVars("MyVar") = Value
End Property
Public Property Get MyVar() As Currency
MyVar = TempVars("MyVar")
End Property
What I can't understand is : If there's a class to be used, why using tempvars at all.
Why not simply using the class Let/Get properties without tempvars?
I think the following will do the same, in only 2 step. Setting a value into the property and then reading it when necessary.
SQL:
Private m_MyVar As Currency
Public Property Get MyVar() As Currency
MyVar = m_MyVar
End Property
Public Property Let MyVar(ByVal iNewValue As Currency)
m_MyVar = iNewValue
End Property
Thanks for any insight on this.
Last edited: