Jump to content
Larry Ullman's Book Forums
Sign in to follow this  
sim

How To List-Up Parent's Path In Recursive Function

Recommended Posts

hi,

this is another question.

 

using recursive function you showed-up the to-do list as follow.

 

1. must do this

2. another task

   1. subtask1

       1. subsubtask1

   2. suntask2

3. new task

 

btw, is it possble to list-up with it's parent's path?

 

that is, i'd like to list-up like this.

 

1. must do this

2. another task

  1. subtask1 : another task * subtask1

      1.subsubtask1 : another task * subtask1 * subsubtask1

   2....

 

thanks.

 

Share this post


Link to post
Share on other sites

Yeah, you could do that, although I think there's an aesthetic argument against doing so. Off the top of my head my inclination is that you'd pass a string as a preface to the recursive function, that string being the parent task. You'd just need to watch the logic such that you wipe it out when you're at the top level and don't display it in that situation. 

Share this post


Link to post
Share on other sites

thanks for your comment.

 

frankly speaking, displayed results is not what the end of my goal.

i'll transform the semi-result to array and then finally explode to calculate accumulated quantity.

(bills of material explosión to make single level BOM.)

 

so the aesthetic thing is not the ploblem.

 

i agonized a few days for this and wondered whether this is possible.

as far as i know it's posible, i'll break more sweats.

 

thanks again Larry.

 

from Korea.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...