LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Parent property of custom class

I have a custom class and one of its properties is another custom
class
Specifically I have a class which interfaces to an external
application to grab data, and a generic sub-class which works out
statistics.

pseudo-code...

set V = new clsCalItem

V.Stats.reset
while not finshed
V.stats.add
wend

msgbox V.stats.count, v.stats.mean

and clsCalItem contains the line
dim Stats as clsStats

My problem is that to get the current numerical value of V I would use
V.Value, but I can't see how to access the .Value method of V with
code inside clsStats.
What I want is basically to be able to use, inside the clsStats code a
line something like:

internalSum = internalSum + Me.Parent.Value

There is a very simple way round this, of course, I can change the
V.Stats.Add line to be V.Stats.Add(V.Value) but I would prefer the
elegance of the first version, and I am rather intrigued about whether
it is possible now. I can see myself wanting to write a .Parent
property in the future in situations where there isn't this
workaround. Surely classes often need to know who or what they are a
subclass of?
 
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
Changing value of Node.Parent destroys .Bold property of entireancestry. [email protected] Excel Programming 1 May 4th 08 09:12 PM
Get Property value of class instance by passing string property name [email protected] Excel Programming 2 October 19th 07 05:47 PM
Parent Properties in Custom Classes J Streger Excel Programming 1 March 28th 07 12:15 AM
Excel VBA Class Objects - Parent & Successor Objects [email protected] Excel Programming 1 January 15th 07 12:06 AM
the Parent property mrmack Excel Programming 3 July 13th 06 04:55 AM


All times are GMT +1. The time now is 09:13 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"