finding child records of child records of child records... with minimal code

This WebDNA talk-list message is from

2000


It keeps the original formatting.
numero = 32715
interpreted = N
texte = I have a db full of category records, with these fields:IDparentIDflagWhen I come in a template I use to flag a category record in this db for later deletion, I also want to find any of its children and flag them also for later deletion, and the children of those children, and the children of those children, .... going down thru how ever many levels of children their are.I.e. if I want to flag the colors category for later deletion, then I need to also flag all children of colors (like Blue, Red, Green, etc) for later deletion and also all children of them (like sky Blue, midnight blue, light red , blood red, mint green, neon green, etc.)I don't know in advance how many levels of children, or children of children, etc... their may be, nor how many children given a certain level...Any ideas how to structure this with just a few lines of code (so I don't have to write an overkill overestimate number of nested searches/replaces)? Do we call what I am looking for recursion??-John ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: finding child records of child records of child records... with minimal code (John Butler 2000)
  2. Re: finding child records of child records of child records... with minimal code (John Peacock 2000)
  3. finding child records of child records of child records... with minimal code (John Butler 2000)
I have a db full of category records, with these fields:IDparentIDflagWhen I come in a template I use to flag a category record in this db for later deletion, I also want to find any of its children and flag them also for later deletion, and the children of those children, and the children of those children, .... going down thru how ever many levels of children their are.I.e. if I want to flag the colors category for later deletion, then I need to also flag all children of colors (like Blue, Red, Green, etc) for later deletion and also all children of them (like sky Blue, midnight blue, light red , blood red, mint green, neon green, etc.)I don't know in advance how many levels of children, or children of children, etc... their may be, nor how many children given a certain level...Any ideas how to structure this with just a few lines of code (so I don't have to write an overkill overestimate number of nested searches/replaces)? Do we call what I am looking for recursion??-John ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/ John Butler

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Has ANYONE gotten the [object] context to work with Java(OSX) ??? HELP! (2002) Typhoon Rev. and PCS store problems (1999) [WebDNA] macOS 10.13.3 and WebDNA Mac Server 8.5.1 - hick-up (2019) Rhapsody? (1997) [Webcat 2]Next (1997) [LOOKUP] (1997) Re:Has this happened to you? (was:Emailer Chokes on bad address) (1997) PCS Frames (1997) Online reference (1997) Problems w/ heavy use of cart header fields? (1998) WebCat2b13MacPlugIn - More limits on [include] (1997) Robert Minor duplicate mail (1997) WebCatalog + WebMerchant 2.1 for Windows released (1998) It gets better... posting problems + Webcat 3.0.7 available - did anyone know? (2000) frames & carts (1997) TCP Connect/send and CGI (2003) PSC recommends what date format yr 2000??? (1997) appleshare/ip (1997) Cookie Newbie (2002) shownext (1997)