Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,059
Default Diff btwn Dim x and Private x in class module?

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Call Private Sub From Different Module Richard Excel Programming 7 October 9th 09 03:42 PM
Private vs Public Class Modules Ronald R. Dodge, Jr.[_2_] Excel Programming 8 January 21st 09 11:47 PM
Improve method of calling a private function in a private module XP Excel Programming 1 April 30th 08 06:41 PM
How to call a private sub() in another module J@Y Excel Programming 4 July 13th 07 08:08 PM
Variable from a sheet module in a class module in XL XP hglamy[_2_] Excel Programming 2 October 14th 03 05:48 PM


All times are GMT +1. The time now is 06:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"