General information
Category:
Coding, syntax & commands
>hi all,
>i have an algorithm problem which needs input from you guys, any help would be >greatly appreciated!
>suppose i have table1 to hold inventory items (finished products). and table2 >to hold items (finished, semi-finished, raw materials) in relation to items in >table1. as in this figure:
>table1 table2 table2
>------ ------ ------
>item1 ----> item1.1
>item1.2 ----> item1.2.1
>item1.3
>item2 ----> item2.1
>item2.2
>item2.3
>wherein item1 is a finished product, which consists of item1.1 (raw material), >item1.2 (semi-finished product) and item1.3 (raw material). since item1.2 is a >semi-finished product, i have to look for its pre-defined details (like i did >for item1) in table 2 also (which is item1.2.1, a raw material).
>im thinking of having a recursive function but does vfp allow this? if so, how >would i do it?
Yes a recursive function will work. We use one to do a bottom level explosion on Bills of Materials like your talking about. The trick is to ensure that your variables are defined in the right scope, and after each function you need to return the cursor back to its original position. there is one detail. functions are recursive to 99 levels. if you need to go deeper than you'll have to some while loops to keep the explosions going.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only