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:
Search with Special Chars (1997)
Limiting user access to .tmpl files (1997)
RE: Displaying Location (1997)
WebDNA Resource Center Resource Center (2004)
[WebDNA] bitly url shortener integration (2016)
Secure Server (1997)
WebCatalog & Mac OS X (client) vs. Redhat Linux (2001)
RE: Answer: WebDelivery downloads alias, not original ? (1997)
removing programming logic white space (2003)
emailer (1997)
multiple databases (1997)
Webcat no longer supported? (2006)
Pithy questions on webcommerce & siteedit (1997)
No Wanna Duppys (1998)
WebCat2 beta 11 - new prefs ... (1997)
Include vs. lookup? (1998)
Maybe off topic but how to charge (1997)
[BoldWords] WebCat.acgib15Mac (1997)
[RESOLVED, I THINK] -- [WebDNA] [append] does not add the newline char at the end of the new record?! (which can causes subsequent [search] to fail.) (2009)
WebCat2final1 crashes (1997)