confusion123
Active Member
- Joined
- Jul 27, 2014
- Messages
- 400
In general, is it preferable to pass variables instead of declaring a variable public (so that its value can be used in separate modules)?
If not, what's the alternative to declaring variables publically?
I've experimented with using classes but it seems an overkill (and even then I have to declare it public once), eg:
In a module, I have:
This is ClsVariables:
If not, what's the alternative to declaring variables publically?
I've experimented with using classes but it seems an overkill (and even then I have to declare it public once), eg:
In a module, I have:
Code:
Global MyCol As ClsVariables
This is ClsVariables:
Code:
Public Property Get Col() As Integer
Col = pCol
End Property
Public Property Let Col(ByVal Co As Integer)
pCol = Co
End Property