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:
Sku numbers (1997)
Multi-processor Mac info ... (1997)
Blank orders after update to 5.1 (2003)
Frames (1997)
Is grep not working with umlauts? (2002)
sku, title, price not showing up (1998)
Checking two required fields (1998)
Plugin or CGI or both (1997)
Robert Minor duplicate mail (1997)
Country & Ship-to address & other fields ? (1997)
[WebDNA] v7 Stress Test and Strange Behaviour (2012)
Separate SSL Server (1997)
[WebDNA] An actual attempt to get WebDNA and MAMP Pro to work - (2018)
Three new problems, maybe a fourth (1997)
Undocumented changes create problems in webcat 4 ... (2000)
Size limit for tmpl editor ? (1997)
shipcost - fed up with the old way (1998)
RE: Timer Values on [redirect] (1998)
When do we get to request new features? (1999)
Daze to Dates (1998)