Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Walkenbach uses examples of Dim x and Private x for non-public
variables in a class module. Is there any semantic difference? I cannot see any. For example: myTest class module: Dim xCnt As Long Private xIdx As Long Private Sub Class_Initialize() xCnt = xCnt + 1 MsgBox xCnt End Sub Property Get cnt() cnt = xCnt End Property Property Let idx(x As Long) xIdx = x End Property Property Get idx() As Long idx = xIdx End Property ----- regular module: Sub testit() Dim a As myTest, b As myTest Set a = New myTest MsgBox a.idx & " " & a.cnt 'initial values a.idx = 2 MsgBox a.idx & " " & a.cnt 'changed values Set b = New myTest MsgBox b.idx & " " & b.cnt 'initial values End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Call Private Sub From Different Module | Excel Programming | |||
Private vs Public Class Modules | Excel Programming | |||
Improve method of calling a private function in a private module | Excel Programming | |||
How to call a private sub() in another module | Excel Programming | |||
Variable from a sheet module in a class module in XL XP | Excel Programming |