View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
RB Smissaert RB Smissaert is offline
external usenet poster
 
Posts: 2,452
Default A good use for an Object Stack?

It sounds you need the treeview control.

RBS


wrote in message
...
Hello, I've done a bit of searching for how and why to use stacks and
I think I've got a good candidate. But I don't have any experience
creating stacks yet and I'd like to make sure I'm headed in the right
direction. I'll be using a stack as a data storage structure.

I'm creating a program for engineers to specify part inspections based
on an assembly tree. My thought is that I will allow the user to
select a top level assembly that is in a text based file and then read
that text file into a custom object stack. The user can then activate
or deactivate each level of the stack in a similar manner to
MSExplorer and then when getting to an individual part the user
selects an inspection type.

example:
The user wants to measure bearings in an engine.

The user will select a text file with the engine assembly in it. The
macro will load the assmbly tree into a sheet which has the first five
columns set up with checkboxes to enable or disable each level of the
assembly tree (the fifth column being an inspection type). If a level
of the assembly is disabled its children are not visible, similar to
exploring for files in Explorer. The user then browses to the
appropriate part through the assembly tree and selects the measurement
type.

Here's my plan:
I'd like four levels of assemblies with the bottom two levels to have
one of five enumerated inspection types. for example:

.A1() 'assembly level 1
.A2() 'assembly level 2 etc
.A3()
.A4()

enum type:
.InspectionType()

where A3() and A4() can have the .InspectionType() property.

continuing my example, the object stack would look like this:
A1("BaseEngine").A2("RotatingAssembly").A3("Cranks haft").A4("Bearings").InspectionType(COmeasure).en abled
= True

a second approach (or perhaps these are the same?):
A1(1).name = "BaseEngine"
A2(1).name = "RotatingAssembly"
A3(3).name = "Crankshaft"
A4(6).name = "Bearings"

A1(1).A2(1).A3(3).A4(6).InspectionType(COmeasure). enabled = True


Do either of these look like a good approach? If so, which one makes
more sense and how do I create the custom objects and their properties
dynamically based on the imported text file?

Thanks for the help!
I'm using MS office Pro 2003 on Windows XP SP3

Best Regards,
Nate