Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo box
Message
From
07/08/2001 19:08:48
 
 
To
07/08/2001 17:53:05
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Title:
Miscellaneous
Thread ID:
00540953
Message ID:
00541032
Views:
19
>>Hi,
>>
>>Thanks for the reply.
>>
>>
>>>
>>oops! I meant to say I used the addobject() function.
>>
>
>whew! < g >
>
>>Thats too bad as I am using vfp 5. Is there another way I can tell if the user changed the value in one of the dynamically created combo boxes? Basically, whenever the user selects a value I have to search through a table and take out any illegal values in the textbox below it.
>>
>
>Then you'll need custom combobox classes with the code already written.
>Let me ask you this before I go on, so I'll have a better idea of what to suggest... How do you know what the illegal values are? Is it much different for each scenario? Does it vary greatly in complexity?

Hi,

Thanks for the reply.

I'll tell you a little about the project. The company I work for builds recycling containers and trucks to empty them. Our product numbers have special meaning. My job is to write a program so that people can use something like a wizard to come up with a product number. From the product number you can tell what exactly went into it. So for example, an product number could look like 'pl4sl-skng'. (translation - 4 yd container with lh small garbage door, rh large garbage door, single lid, lh nondrip couplers with hoses to the right, green) So the PL part is the series. The 4 part is the capacity (4 cu yd in this case). S-small garbage loading door. L- large garbage loading door. S- single unloading lid, etc. But depending on the previous selection the results for the next set of options is different. For example, the PL series can have a 4.5 Cu yd capacity. To make things more complicated you can have left hand side or right hand side applications. But in order to do that you must have a divided compartment (who's letter appears after the lh and rh side applications), you can have more then one lh and rh side applications, etc. So anyways, there's the basic idea. I don't even really fully understand all the special rules yet...

It is fairly complex as to determine illegal values. To initially get all the comboboxes I write an sql statement based on a question answered by the user. Then I do a scan loop and do addobject and I wind up with combo boxes representing a choice for each letter. I have a 'negative' rules table. So if the user say selects PL Series in combobox1, then I scan through the rules table and remove items in combobox2 that don't meet the rules. (basically if a value is present in the rules table then it is an illegal value) Phew... Sorry for being long winded.

I could probably fairly easy 'hard code' this but my boss wants it to be easily updated. So if there are new rules they just have to add them to the rules table, etc. No need to edit the code and recompile. (that is why I am dynamically created comboboxes)

Also, if you have any other ideas (perhaps a form for each question instead of lots of combo boxes?) to accomplish this I'm open to ideas. Well, its 5pm, so I'm going to go home and not think about this for a while. :)

Thanks you very much,
Chris
Previous
Reply
Map
View

Click here to load this message in the networking platform