Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 4th, 2003, 07:20 AM
williamcrawley williamcrawley is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: uk
Posts: 91 williamcrawley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Design pattern needed

I Have a Structure Table made of

Parent Child ChildQty
SAA015 LD 1.2
SAA015 SAA017 3.2
SAA017 MD0122 2
SAA017 SAB019 3
SAB019 MA0143 2


The above is an example of a structure

I create a recordset based on a parent key of SA015. So my Parent recordset consists of 2 records.

I then need to loop round to obtain a total figure.

So on the first record I simply read my table Labour table with the key LD and obtain details. I then need to perform a calculation on the record and add the values to temporary store.

Then I go to my second record and I see that it is made up of another structure SAA017 I therefore need to read the structure table again to find out what the SAA017 record is made up of. The first time in, it’s made up of a Material Record MD0122 so I read values from this table and place it in a new temporary store.

The second record of SAA017 is made up of Structure SAB019, again I have to read the structure table to find out what it comprises of this time it’s Material MA0143 so I now take my calculation of MA013 and with additional calculation make another with the MD0122 calculation (second temporary store) then this with my first temporary store and the LD record so that I end up with a single value for the original SAA Structure.

As an easier example
SAA010 LD 0.5
SAA010 MAA019 2.3
SAA010 MDE040 0.7

In this structure my recordset would have 3 records and I would loop 3 times calling either my labour or my material table for values and perform a calculation.

It’s when a structure comprises of another structure that the problem starts. Structures can have an infinite number of structures within them.

I need a design pattern to overcome this.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Design pattern needed


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT