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:ID
parentIDflagWhen 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 thechildren of those children, and the children of those children, .... going down thruhow ever many levels of children their are.I.e. if I want to flag the colors category for later deletion, then I need to alsoflag all children of colors (like Blue, Red, Green, etc) for later deletion andalso 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 writean overkill overestimate number of nested searches/replaces)? Do we call what I amlooking 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:
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 thechildren of those children, and the children of those children, .... going down thruhow ever many levels of children their are.I.e. if I want to flag the colors category for later deletion, then I need to alsoflag all children of colors (like Blue, Red, Green, etc) for later deletion andalso 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 writean overkill overestimate number of nested searches/replaces)? Do we call what I amlooking 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:
US Postal Service API (2007)
ShowIf variables (1997)
Pithy questions on webcommerce & siteedit (1997)
Dumb Question about Docs (1997)
Strange Search Results (2004)
Re:Help name our technology! (1997)
Question re: FlushDatabases (1997)
multi-paragraph fields (1997)
Automatic thumbnail images (1998)
# fields limited? (1997)
Pithy questions on webcommerce & siteedit (1997)
duplicating cart items (1998)
Need help (1998)
NT License trade for Mac (2000)
Web Catalog vs. ICAT (1997)
emailer setup (1997)
available times? (2003)
Ooops-Serial Number for NT (1997)
Possible Bug in 2.0b15.acgi (1997)
Deleting with contexts (2001)