Hi everybody and good evening to all of you who work on weekends!

I have a problem that is too difficult for me alone to solve:

I want to generate a sitemap dynamically. As chapters are added they should
be displayed in a tree-like hierarchical menu and be accessible by that
menu. Let's say I have a main menu, I name it "1" From there I can choose
out of three chapters, I name them "11", "12" and "13". Each of the chapters
has an unpredictable number of subchapters. I think you get the idea.

If it weren't the tree structure but something linear, it would be simple to
put all chapters in a linear list. Now I probably have to build a
multidimensional array, the branches of which have an unregular number of
sub-branches and so forth.

The multidimensional array will contain links to the respective movies that
can be run by choosing them in the sitemap.

How can this be done in an elegant manner? I have tried it for hours now,
but my main problem is: If my item is in the fourth hierarchy (for instance
"1615") then I would have to retrieve my value with a something like: value
= array[1][6][1][5]. This only works if in the first hierarchy there are at
least 1, in the second 6 in the third 1 and in the fourth 5 elements . As I
said, I want to create that tree dynamically, so it is possible that I might
have to create an element for which there are no branches yet that lead to
that element. I have to create them, before I place my value in the new
place. If I don't, naturally, I get an index out of range error. But how do
I check if in my array there are the branches that are needed and how do I
create them with a minimal effort?

Thank you very much for your suggestions!

Michael von Aichberger


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to