Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: STL / Iterators ----


Message #1 by "md. shahid rahman" <ejaz@v...> on Fri, 7 Feb 2003 10:14:37
Sir,
many thanks for the reply...
No I have not make any table as yet....will be planning the tables in a day
or two......I am using Visual Basic 6.....
Thanks for the Prototype of the function. I will do contact you if I need
any help...as i am very new to VB thing.....
Thanks
Shahid




----- Original Message -----
From: Ian Bambury - JASWW <email.address@v...>
To: professional vb <pro_vb@p...>
Sent: Friday, February 07, 2003 4:43 PM
Subject: [pro_vb] Re: STL / Iterators ----


> Do you already have a database or a file structure, or are you going to
have to create one?
>
> Sorry to repeat myself, but are you using VB6 or VB.Net?
>
> In general, you need to create a subroutine which calls itself until it
runs out of sub-levels.
>
> If you have a table in a database with two columns 'parent' and 'child'
you would do something like:
>
>
> Function GetSubordinates(whoever)
>     dim total
>     Get list of children where parent = whoever
>     total = count of children
>     for each child
>         total = total + GetSubordinates(child)
>     next
>     return total
> End Function
>
> so the first iteration would get all the children of 'A'
>
> for each of these, we get the total or *their* children
>
> for each of these, we get the total or *their* children
>
> etc, etc, until we run out of levels
>
> If you get stuck, feel free to email me
>
> Cheers,
>
> Ian
>
> Ian Bambury
> Ecommerce Project Manager
> JAS Worldwide
> ibambury@j...
> www.jasww.com
>
>   ----- Original Message -----
>   From: ejaz
>   To: professional vb
>   Sent: Friday, February 07, 2003 10:42 AM
>   Subject: [pro_vb] Re: STL / Iterators ----
>
>
>   yes you are right sir...thats what exactly i want to do....
>   Each person has a seperate ID...and by that ID I have to calculate that
how
>   many members he has made under him....
>   e.g
>   At the top level there is MR.A...He makes 4 persons (p,q,r,s) under
>   him....Now "p" couldnt make any members,    "q" made one 3 members but
"r"
>   and "s" made many members  (j,k,l,m......n) under them...Again
>   j,k,l,m........n made some members under them.....
>   Now what I want to do is that I want to know that how many people are
under
>   MR.A just by entering his ID.....I also want to know how many peoples
are
>   there under Mr.J or say Mr.M....by entering their IDs....
>   I dunno how to proceed with this....
>   A help will be very much appreciated
>   Thanking you in advance....
>   Shahid
>
>



  Return to Index