Additional, programmer oriented, site details

The REXX/ARexx scripts that build this site use a tree-based menu definition in which, using an n.x.y=z type compound variable, x represents the level in the menu tree, y represents the number of pages present at that level, and z represents the number of descendents which that page node has. The stem, n., is initialised to -1 to allow the tree searching routines to recognise unused page nodes. For example...

        n.=-1

        n.0=4    /* 4 levels */

        n.1.1=10 /* this root page has ten descendant pages */
                 /* in other words this page has ten menu options */
                         
        n.2.1=2  /* first page at second level has two descendant pages */
        .        /* two menu options for this page! */
        .

With this definition available the required pages are generated using a loop which in ARexx form looks like this...

        do level = 1 to n.0        
           page_start=0
           say CountNodes(level) 'pages at level' level
           do node=1 to CountNodes(level)
              entries=n.level.node
              call GeneratePage(level,node,page_start,entries)     
              page_start=page_start+entries      
           end
        end

With the equivalent loop in Personal REXX a slight change is needed to allow the GeneratePage() routine to be written with the arguments in parenthesis (just a coding preference of mine)...

        do level = 1 to n.0        
           page_start=0
           say CountNodes(level) 'pages at level' level
           do node=1 to CountNodes(level)
              entries=n.level.node
              d=GeneratePage(level,node,page_start,entries)     
              page_start=page_start+entries      
           end
        end

These loops effectively carry out a level-by-level search of the menu tree. Because, however, both level and page numbers are known during this loop it is possible for the GeneratePage() routine to automatically generate a page name in the form LxPy.htm (where x is the level and y is the page number). Similarly the name of an associated text file (LxPy.txt) can also be produced.

In this way the page creation routine is able to use ARexx's Exists() function, or the QUERY EXISTS Stream() command with Personal REXX, to check whether page text file is available for each page being generated. If a file is found it is read in and used as appropriate. When such files are not found default page headings and menu entries are inserted instead. Date stamps files are similarly checked for and inserted into the final HTML file.

Additional, and more detailed, explanations of how this is achieved will be posted here in due course!


Go back toReturn to page at previous level

Go back toReturn to main index page

Page last updated 21-Nov-96