home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / ppwizard.zip / ol_doc.dh < prev    next >
Text File  |  2000-02-19  |  87KB  |  1,308 lines

  1. ;----------------------------------------------------------------------------
  2. ;     MODULE NAME:   OL_DOC.DH
  3. ;
  4. ;         $Author:   Dennis_Bareis  $
  5. ;       $Revision:   1.22  $
  6. ;           $Date:   19 Feb 2000 15:06:10  $
  7. ;        $Logfile:   E:/DB/PVCS.IT/OS2/PPWIZARD/OL_DOC.DHV  $
  8. ;
  9. ;      DOCUMENTED:   In PPWIZARD manual.
  10. ;                    ~~~~~~~~~~~~~~~~~~~
  11. ;
  12. ;     DESCRIPTION:   This is a header file for handling generic input files
  13. ;                    and generating INF or HTML files.
  14. ;
  15. ;                    The user can #undef and re-#define any of the definitions
  16. ;                    created here to get different backgrounds etc.
  17. ;
  18. ;                    The user can of course define their own macros and should
  19. ;                    also definately have a look at the #AsIs command and its
  20. ;                    examples.  Unless you wish to disable IPF generation etc
  21. ;                    you should code your macros very carefully to work with
  22. ;                    all document types.
  23. ;
  24. ;
  25. ;           INPUT:   You must have set up the "DocType" variable to be "HTML"
  26. ;                    or "IPF" prior to including this header.  It is
  27. ;                    recommended that the "/define" switch be used to keep
  28. ;                    your source input independant from the generated type.
  29. ;
  30. ;
  31. ;            NOTE:   Both the IPF and HTML version of PPWIZARD's documentation
  32. ;                    use this header to generate the manuals.
  33. ;
  34. ;                    When I get time I will document this header file and the
  35. ;                    macros etc.  In the mean time please see the example in
  36. ;                    manual, or email me for help.  I could send you the
  37. ;                    source for PPWIZARD's manual.
  38. ;----------------------------------------------------------------------------
  39. ;#define OL_DOC_TRY_JAVA_NAVIGATION         ;;Not happy with current state of java applet/JVMs
  40.  
  41. ;--- Define the version number of this header file --------------------------
  42. #define   VERSION_OL_DOC_OH    00.042
  43. #require  99.352
  44.  
  45.  
  46. ;--- This Header only support HTML & IPF ------------------------------------
  47. #if    '<$DocType>' <> 'HTML' & '<$DocType>' <> 'IPF'
  48.        #error  'OL_DOC.OH: The document type "<$DocType>" is unsupported in version <$VERSION_OL_DOC_OH>'
  49. #endif
  50.  
  51. ;--- Warnings generated by this header file ---------------------------------
  52. #define WARNINGID_INVALID_HEADING_REF 'HIDR'
  53. #define WARNINGID_IPF_ONLY            'IPFO'
  54. #define WARNING_NOW_IPF_ONLY                                                          \
  55.         #warning <$WARNINGID_IPF_ONLY> "A tag that is currently only supported by IPF was used"
  56.  
  57. ;--- Define some aliases for characters we need to be careful with ----------
  58. #define PlaySafe                    ;;Sometimes need to be careful about what starts a line (example read in "#if" - we don't want to execute!)
  59. #if    ['<$DocType>' = 'HTML']
  60.        ;--- HTML ------------------------------------------------------------
  61.        #RexxVar  "LT"   =x= "<"               ;;'<' Char
  62.        #RexxVar  "GT"   =x= ">"               ;;'>' Char
  63.        #RexxVar  "AMP"  =x= "&"              ;;'&' Char
  64.        #RexxVar  "COL"  =x= ":"                  ;;':' Char
  65. #elseif
  66.        ;--- IPF -------------------------------------------------------------
  67.        #RexxVar  "LT"   =x= "<"                  ;;'<' Char
  68.        #RexxVar  "GT"   =x= ">"                  ;;'>' Char
  69.        #RexxVar  "AMP"  =x= "&."              ;;'&' Char
  70.        #RexxVar  "COL"  =x= "&colon."            ;;':' Char
  71. #endif
  72. #RexxVar         "HASH"      =x= "#"                  ;;'#' Char
  73. #RexxVar         "SEMICOLON" =x= ";"                  ;;';' Char
  74.  
  75. ;--- Set up AsIs Mode -------------------------------------------------------
  76. #AutoTagState +
  77.    ;--- Define characters that should be automatically modified -------------
  78.    #AutoTag  "<"   "<?xLT>"
  79.    #AutoTag  ">"   "<?xGT>"
  80.    #AutoTag  "&"   "<?xAMP>"
  81.    #AutoTag  ":"   "<?xCOL>"
  82.    #AutoTag  "#"   "<?xHASH>"
  83.  
  84.    ;--- "PROGRAM" ASIS mode (save as "ASIS_OL_DOC") -------------------------
  85.    #AsIs  SETUP    ASIS_OL_DOC
  86. #AutoTagState -
  87.  
  88. ;--- Generating IPF or HTML (or whatever)? ----------------------------------
  89. #if    ['<$DocType>' = 'HTML']
  90.        ;--- Determine what extension to use for generated files -------------
  91.        #define   HtmlExtension   htm        ;;For now hardcode
  92.  
  93.        ;--- Generating HTML -------------------------------------------------
  94.        #ifndef OL_DOC_HTML_BODY
  95.            #define OL_DOC_HTML_BODY <BODY>        ;;User did not provide alternative BODY tag
  96.        #endif
  97.        #ifndef OL_DOC_HTML_GENERATOR_TAGS              ;;Empty to not generate anything!
  98.                #define OL_DOC_HTML_GENERATOR_TAGS <META NAME="GENERATOR" CONTENT="FREE PPWIZARD v<?Version> using 'OL_DOC.DH' v<$VERSION_OL_DOC_OH> (<?PpwizardHomePage>)"><?NewLine>
  99.        #endif
  100.        #ifndef OL_DOC_HTML_META_TAGS
  101.                #define OL_DOC_HTML_META_TAGS
  102.        #endif
  103.        #define   HeadingCodes                                    \
  104.                  <HTML><HEAD>                                   %\
  105.                  <TITLE>{$Text}</TITLE>                         %\
  106.                  #ifndef OL_DOC_HTML_ALLOW_ROBOTS               -\
  107.                     <META name="robots" content="NOINDEX">      %\
  108.                  #endif                                         -\
  109.                  <$OL_DOC_HTML_GENERATOR_TAGS>                  %\
  110.                  <$OL_DOC_HTML_META_TAGS TITLE={$Text $$AQ}>    %\
  111.                  </HEAD>                                        %\
  112.                  <$OL_DOC_HTML_BODY>
  113.        #define   TrailingCodes   </BODY></HTML>
  114.        #define   Colon           :
  115.        #define   Amp             &
  116.        #define   LT              <
  117.        #define   GT              >
  118. ;;;    #define   NoBreakingBlank  
  119.        #define   NoBreakingBlank          ;;Better supported (so I hear!)
  120.  
  121.        ;--- Whitespace Macros -----------------------------------------------
  122.        #define   P               <?NewLine><?NewLine><P>
  123.        #define   BR              <?NewLine><BR>
  124.  
  125.        ;--- Different text colors and effects -------------------------------
  126.        #define   Red             <FONT COLOR=RED>{$Text}</FONT>
  127.        #define   DarkGreen       <FONT COLOR=GREEN>{$Text}</FONT>
  128.        #define   Magenta         <FONT COLOR=MAGENTA>{$Text}</FONT>
  129.        #define   Bold            <B>{$Text}</B>
  130.        #define   Italic          <I>{$Text}</I>
  131.        #define   BoldUnderline   <B><U>{$Text}</U></B>
  132.        #define   BoldItalic      <$Bold Text=<$Italic Text={$Text}>>
  133.  
  134.        ;--- Work out what extension to use (.htm, .HTM, .html etc) ----------
  135.        #evaluate ""  ^parse value _filespec('name', '<?OutputFile>') with .'.'HtmlExtn^
  136. #elseif
  137.        ;---------------------------------------------------------------------
  138.        ;--- Generating IPF  -------------------------------------------------
  139.        ;---------------------------------------------------------------------
  140.        #define   HeadingCodes    :userdoc.<?NewLine>:Title.{$Text}<?NewLine>:docprof toc=123456.
  141.        #define   TrailingCodes   :euserdoc.
  142.        #define   Colon           &colon.
  143.        #define   Amp             &.
  144.        #define   NoBreakingBlank &rbl.
  145.        #define   LT              <?xLT>
  146.        #define   GT              <?xGT>
  147.  
  148.        ;--- What characters are invalid in IPF IDs --------------------------
  149.        #RexxVar  InvalidIdChars  = " `~!@%^&-+=',.\|"    ;;Must include SPACE!
  150.  
  151.        ;--- Whitespace Macros -----------------------------------------------
  152.        #define   P               :p.
  153.        #define   BR              .BR<?NewLine>           ;;Must be used at start of line, text immediately follows.
  154.  
  155.        ;--- Different text colors and effects -------------------------------
  156.        #define   Red             :hp8.{$Text}:ehp8.
  157.        #define   DarkGreen       :color fc=darkgreen.{$Text}:color fc=default.
  158.        #define   Magenta         :hp9.{$Text}:ehp9.
  159.        #define   Bold            :hp2.{$Text}:ehp2.
  160.        #define   Italic          :hp1.{$Text}:ehp1.
  161.        #define   BoldUnderline   :hp7.{$Text}:ehp7.
  162.        #define   BoldItalic      :hp3.{$Text}:ehp3.
  163. #endif
  164. #define   Para                   <$P>                  ;;Set up alias which user may prefer to use
  165.  
  166.  
  167.  
  168. ;----------------------------------------------------------------------------
  169. ;--- Generates a valid ID for a heading section -----------------------------
  170. ;----------------------------------------------------------------------------
  171. #if    ['<$DocType>' = 'HTML']
  172.        ;--- HTML ------------------------------------------------------------
  173.        #evaluate ''   ^call GetIdPrepare 'OL_DOC'^     ;;Prepare for generating headings
  174.        #ifdef    OL_DOC_IDS_ARE_CASE_SENSITIVE
  175.            ;--- User cares about case of generated HTML ---------------------
  176.            #ifndef   OL_DOC_HTML_8_3_NAMES
  177.                    ;--- Long filenames for HTML OK ----------------------------
  178.                    #define   RexxGenerateValidId       \
  179.                                RxValidId = EnsureFileHasCorrectCase( GetId('OL_DOC', '2_',       ExpandXCodes('{$Id $$SQx2}')) )
  180.            #elseif
  181.                    ;--- Want 8.3 filenames for HTML ---------------------------
  182.                    #define   RexxGenerateValidId       \
  183.                                RxValidId = EnsureFileHasCorrectCase( GetId('OL_DOC', 'MAXCHARS', ExpandXCodes('{$Id $$SQx2}')) )
  184.            #endif
  185.        #else
  186.            ;--- User wants IDs to match no matter what the case -------------
  187.            #ifndef   OL_DOC_HTML_8_3_NAMES
  188.                    ;--- Long filenames for HTML OK ----------------------------
  189.                    #define   RexxGenerateValidId       \
  190.                                RxValidId = EnsureFileHasCorrectCase( GetId('OL_DOC', '2_',       translate(ExpandXCodes('{$Id $$SQx2}'))) )
  191.            #elseif
  192.                    ;--- Want 8.3 filenames for HTML ---------------------------
  193.                    #define   RexxGenerateValidId       \
  194.                                RxValidId = EnsureFileHasCorrectCase( GetId('OL_DOC', 'MAXCHARS', translate(ExpandXCodes('{$Id $$SQx2}'))) )
  195.            #endif
  196.        #endif
  197. #elseif
  198.        ;--- IPF ID's don't need to look pretty as no one sees them ----------
  199.        #define   RexxGenerateValidId                 \
  200.                  RxValidId = translate(translate(ExpandXCodes('{$Id $$SQx2}')),, InvalidIdChars, '_')
  201. #endif
  202.  
  203.  
  204.  
  205. ;----------------------------------------------------------------------------
  206. ;--- The following provide some validations of headings against references --
  207. ;----------------------------------------------------------------------------
  208. #DefineRexx RexxRememberHeading    ;;Remember heading ID (should only be called once for each ID!)
  209.         HeadIdFlag = '!RxHeadId_' || c2x(RxValidId);
  210.         if symbol(HeadIdFlag) = 'VAR' then
  211.            Error('Duplicated Heading ID, first used at ' || _valueG(HeadIdFlag))
  212.         call _valueS HeadIdFlag, CurrentSourceLocation();
  213. #DefineRexx
  214. #DefineRexx HeadingIdReference     ;;Someone wants to link to a heading, remember this
  215.             RxHeadingRefCnt = RxHeadingRefCnt + 1;
  216.             RxHeadingRefID.RxHeadingRefCnt  = RxValidId;
  217.             RxHeadingRefLOC.RxHeadingRefCnt = CurrentSourceLocation();
  218. #DefineRexx
  219. #DefineRexx RexxValidateHeadingReferences  ;;At EOF we need to check references against headings
  220.             RefErrCnt = 0;
  221.             do HeadIndex = 1 to RxHeadingRefCnt
  222.                HeadIdFlag = '!RxHeadId_' || c2x(RxHeadingRefID.HeadIndex);
  223.                if  symbol(HeadIdFlag) <> 'VAR' then
  224.                do
  225.                    RefErrCnt = RefErrCnt + 1;
  226.                    #option PUSH AllowPack=NO
  227.                    call Warning <$WARNINGID_INVALID_HEADING_REF>, 'Unknown ID of "' || RxHeadingRefID.HeadIndex || '" used at ' || RxHeadingRefLOC.HeadIndex;
  228.                    #option POP
  229.                end;
  230.             end;
  231.             if RefErrCnt <> 0 then
  232.                call Summary 'Inv References', RefErrCnt || ' (missing headings?)';
  233. #DefineRexx
  234. #OnExit    <$ValidateHeadingReferences>
  235. #define    ValidateHeadingReferences                        \
  236.            #evaluate ^^ ^<$RexxValidateHeadingReferences>^
  237.  
  238.  
  239.  
  240.  
  241. ;----------------------------------------------------------------------------
  242. ;--- MAIN DOCUMENT Start/End Macros -----------------------------------------
  243. ;----------------------------------------------------------------------------
  244. #evaluate '' ^parse value _filespec("name", "<?OutputFile>") with ContentsId'.'.^
  245. #if    ['<$DocType>' = 'HTML']
  246.        #evaluate '' ^RxValidId=ContentsId; <$RexxRememberHeading>^   ;;Remember contents ID
  247. #endif
  248. #RexxVar RexxHeadingIdLastUsed = ''         ;;Initialize values
  249. #RexxVar HtmlNextId            = ''
  250. #RexxVar HtmlNextIdText        = ''
  251. #RexxVar HtmlPrevId1           = ContentsId
  252. #RexxVar HtmlPrevIdText1       = 'Contents'
  253. #RexxVar HtmlPrevId2           = ''
  254. #RexxVar HtmlPrevIdText2       = ''
  255. #RexxVar HtmlPagesGenerated    = 1          ;;Count contents page!
  256. #ifndef OL_DOC_HTML_CONTENTS_TITLE
  257.         #define    OL_DOC_HTML_CONTENTS_TITLE   Contents
  258. #endif
  259. #define   DocumentStart                                                 \
  260.           #ifdef _DocumentStart_                                       -\
  261.                  #error "OL_DOC: Only allowed to start document once!" -\
  262.           #endif                                                       -\
  263.           #define  _DocumentStart_                                     -\
  264.           #Rexxvar RxHeadingLevel  = 1                                 -\
  265.           #Rexxvar RxHeadingRefCnt = 0                                 -\
  266.           #if  ['<$DocType>' = 'IPF']                                  -\
  267.                <$HeadingCodes TEXT={$Text='No Title'}><?NewLine>     -\
  268.           #endif
  269. #define   DocumentEnd                                                   \
  270.           #if  ['<$DocType>' = 'HTML']                                 -\
  271.                #RexxVar RexxHeadingIdLastUsed = '' ;;Not in heading    -\
  272.                #if  [<?OutputLevel> <> 1]                              -\
  273.                     #RexxVar HtmlNextId     = ''                       -\
  274.                     #RexxVar HtmlNextIdText = ''                       -\
  275.                     <$_HeadingEndHtml>   ;;Finish off previous heading -\
  276.                #endif                                                  -\
  277.                <$_GenerateContentsHtml>       ;;Output contents        -\
  278.           #endif                                                       -\
  279.           #if  ['<$DocType>' = 'IPF']                                  -\
  280.                <$TrailingCodes>        ;;Output trailing HTML codes    -\
  281.           #endif                                                       -\
  282.           #eof  {$EndIf=""}            ;;Thats All Folks
  283.  
  284.  
  285.  
  286. ;----------------------------------------------------------------------------
  287. ;--- HEADINGS ---------------------------------------------------------------
  288. ;----------------------------------------------------------------------------
  289. #if    ['<$DocType>' = 'HTML']
  290.        ;--- HTML version ----------------------------------------------------
  291.        #OnExit <$DisplayPagesInSummary>
  292.        #define DisplayPagesInSummary                                      \
  293.                #evaluate ^^ ^call Summary 'Generated', HtmlPagesGenerated || ' HTML Pages'^
  294.        #define Target           <A NAME="{$NAME}">
  295.        #define Heading                                                    \
  296.                ;--- Count pages ---------------------------------------  -\
  297.                #RexxVar  HtmlPagesGenerated + 1                          -\
  298.                                                                          -\
  299.                ;--- Generate ID save heading info ---------------------  -\
  300.                #evaluate ^^ ^<$RexxGenerateValidId ID={$ID={$Text}}>;<$RexxRememberHeading>^ -\
  301.                #RexxVar RexxHeadingLastUsed    =  "{$Text}"              -\
  302.                #RexxVar RexxHeadingIdLastUsed  =  RxValidId              -\
  303.                                                                          -\
  304.                ;--- Previous heading complete -------------------------  -\
  305.                #if  [<?OutputLevel> <> 1]                                -\
  306.                      #RexxVar HtmlNextId     = RxValidId                 -\
  307.                      #RexxVar HtmlNextIdText = "{$Text}"                 -\
  308.                     <$_HeadingEndHtml>                                   -\
  309.                #endif                                                    -\
  310.                                                                          -\
  311.                ;--- Wrap PREV heading IDs -----------------------------  -\
  312.                #RexxVar HtmlPrevId2     =  HtmlPrevId1                   -\
  313.                #RexxVar HtmlPrevId1     =  RexxHeadingIdLastUsed         -\
  314.                #RexxVar HtmlPrevIdText2 =  HtmlPrevIdText1               -\
  315.                #RexxVar HtmlPrevIdText1 =  RexxHeadingLastUsed           -\
  316.                                                                          -\
  317.                ;--- Update Contents List ------------------------------  -\
  318.                                                                          -\
  319.                ;--- Start New HTML file for new section ---------------  -\
  320.                #output  "<??RxValidId>"                                  -\
  321.                <$HeadingCodes TEXT={$Text}>                            -\
  322.                                                                          -\
  323.                ;--- Label the top of the file -------------------------  -\
  324.                <A NAME="TOP"></A>                                        -\
  325.                                                                          -\
  326.                ;--- Generate start HTML buttons -----------------------  -\
  327.                #OutputHold                                               -\
  328.                <$_GenerateStartOfHtmlButtons>                            -\
  329.                                                                          -\
  330.                ;--- Generate TITLE unless user said not to ------------  -\
  331.                #ifndef OL_DOC_HEADINGS_DONT_GENERATE_TITLE               -\
  332.                        <CENTER><H1>{$Text}</H1></CENTER>                 -\
  333.                #endif                                                    -\
  334.                <$_AddToContents ID=■{$ID={$Text}}■ TEXT={$Text}>
  335.        #define _HeadingEndHtml                                                 \
  336.                #if [<?OutputLevel> <> 1]                                      -\
  337.                    <A NAME="BOTTOM"></A>                                      -\
  338.                     #OutputHold "FixUpNextPageLink"                           -\
  339.                    <$_GenerateEndOfHtmlButtons>                               -\
  340.                #endif                                                         -\
  341.                <$TrailingCodes>               ;;Output trailing HTML codes    -\
  342.                #if [<?OutputLevel> <> 1]                                      -\
  343.                    #output                    ;;Close off generated HTML file -\
  344.                #endif
  345.        #define _GenerateStartOfHtmlButtons                                     \
  346.                <CENTER>                                                       -\
  347.                #ifdef  OL_DOC_HTML_NOCONTENTS_HEADER                          -\
  348.                        <$OL_DOC_HTML_NOCONTENTS_HEADER>                       -\
  349.                #endif                                                         -\
  350.                <TABLE BORDER=3 CELLSPACING=3 CELLPADDING=3>                   -\
  351.                <TR>                                                           -\
  352.                    <TD><$OL_DOC_HTML_BOTTOM>                                  -\
  353.                    <TD><$OL_DOC_HTML_CONTENTS>                                -\
  354.                        <$OL_DOC_HTML_SEARCH>                                  -\
  355.                    #if [HtmlPrevId2 <> '']                                    -\
  356.                        <TD><$OL_DOC_HTML_PREV Page="<??HtmlPrevId2>" TITLE="<??HtmlPrevIdText2>">  -\
  357.                    #endif                                                     -\
  358.                    <$OL_DOC_HTML_HOME>                                        -\
  359.                    <TD><$OL_DOC_HTML_NEXT Page="[#Page]" TITLE="[#Title]">    -\
  360.                </TR>                                                          -\
  361.                </TABLE></CENTER>                                              -\
  362.                <HR>
  363.        #define _GenerateEndOfHtmlButtons                                       \
  364.                <P><HR>                                                        -\
  365.                <CENTER>                                                       -\
  366.                <TABLE BORDER=3 CELLSPACING=3 CELLPADDING=3>                   -\
  367.                <TR>                                                           -\
  368.                    <TD><$OL_DOC_HTML_TOP>                                     -\
  369.                    <TD><$OL_DOC_HTML_CONTENTS>                                -\
  370.                        <$OL_DOC_HTML_SEARCH>                                  -\
  371.                    #if [HtmlPrevId2 <> '']                                    -\
  372.                        <TD><$OL_DOC_HTML_PREV Page="<??HtmlPrevId2>" TITLE="<??HtmlPrevIdText2>"> -\
  373.                    #endif                                                     -\
  374.                    #if [HtmlNextId <> '']                                     -\
  375.                        <TD><$OL_DOC_HTML_NEXT Page="<??HtmlNextId>" TITLE="<??HtmlNextIdText>">   -\
  376.                    #endif                                                     -\
  377.                    <$OL_DOC_HTML_HOME>                                        -\
  378.                </TR></TABLE>                                                  -\
  379.                </CENTER>                                                      -\
  380.                #ifdef  OL_DOC_HTML_FOOTER                                     -\
  381.                        <$OL_DOC_HTML_FOOTER CONTENTS='N'>                     -\
  382.                #endif
  383.        #DefineRexx "FixUpNextPageLink"
  384.                     ;--- We now know next page, fix up links at top of page ---
  385.                     Nid  = HtmlNextId;
  386.                     NTit = HtmlNextIdText;
  387.                     if Nid = '' then
  388.                     do
  389.                        ;--- Bit of a cludge (really should get rid of link) --
  390.                        Nid  = ContentsId;
  391.                        NTit = '[CONTENTS]';
  392.                     end;
  393.                     HeldOutput = ReplaceString(HeldOutput, "[#Page]",  Nid);
  394.                     HeldOutput = ReplaceString(HeldOutput, "[#Title]", NTit);
  395.        #DefineRexx
  396. #elseif
  397.        ;--- IPF version -----------------------------------------------------
  398.        #define Target                          ;;No support for targets!
  399.        #define Heading                                                    \
  400.                ;--- Generate ID save heading info ---------------------  -\
  401.                #evaluate ^^ ^<$RexxGenerateValidId ID={$ID={$Text}}>;<$RexxRememberHeading>^ -\
  402.                #RexxVar RexxHeadingLastUsed    =  "{$Text}"              -\
  403.                #RexxVar RexxHeadingIdLastUsed  =  RxValidId              -\
  404.                                                                          -\
  405.                ;--- Generate the heading ------------------------------  -\
  406.                :h<??RxHeadingLevel> id=<??RxValidId>.{$Text}             -\
  407.                                                                          -\
  408.                ;--- Generate TITLE unless user said not to ------------  -\
  409.                #ifndef OL_DOC_HEADINGS_DONT_GENERATE_TITLE               -\
  410.                        <$Title TEXT={$Text}>                           -\
  411.                #endif
  412. #endif
  413. #define   HeadingAt                                         \
  414.           #Rexxvar RxHeadingLevel  =  "{$Level}"            \
  415.           <$ValidateRxHeadingLevel>
  416. #define   HeadingUp                                         \
  417.           #Rexxvar RxHeadingLevel  - 1                      \
  418.           <$ValidateRxHeadingLevel>
  419. #define   HeadingDown                                       \
  420.           #Rexxvar RxHeadingLevel  + 1                      \
  421.           <$ValidateRxHeadingLevel>
  422. #define   HeadingSave                                       \
  423.           #Rexxvar RxHLvl_{$NAME=""} = RxHeadingLevel
  424. #define   HeadingRestore                                    \
  425.           #Rexxvar RxHeadingLevel    = RxHLvl_{$NAME=""}
  426. #define   ValidateRxHeadingLevel                                                     \
  427.           ;--- Validate the heading level --------------------------                 \
  428.           #if [RxHeadingLevel < 1]                                                   \
  429.               #Error "Heading level of <??RxHeadingLevel> is invalid (must be 1-6)." \
  430.           #endif                                                                     \
  431.           #if [RxHeadingLevel > 6]                                                   \
  432.               #Error "Heading level of <??RxHeadingLevel> is invalid (must be 1-6)." \
  433.           #endif
  434.  
  435.  
  436.  
  437. ;----------------------------------------------------------------------------
  438. ;--- LINKS ------------------------------------------------------------------
  439. ;----------------------------------------------------------------------------
  440. #if    ['<$DocType>' = 'HTML']
  441.        ;--- HTML version ----------------------------------------------------
  442.        #define   LinkTo                                                     \
  443.                  #evaluate ^^ ^<$RexxGenerateValidId ID={$ID={$Text}}>;<$HeadingIdReference>^ -\
  444.                  #if ['{$Target=''}' = '']                                 -\
  445.                      ;--- No TARGET -----------------                      -\
  446.                      #if [RexxHeadingIdLastUsed = RxValidId]               -\
  447.                          <$PlaySafe>{$Text}                                -\
  448.                      #elseif                                               -\
  449.                          <A HREF="<??RxValidId>.<$HtmlExtension>">{$Text}</A> -\
  450.                      #endif                                                -\
  451.                  #elseif                                                   -\
  452.                      #if [RexxHeadingIdLastUsed = RxValidId]               -\
  453.                          <A HREF="#{$Target}">{$Text}</A>                  -\
  454.                      #elseif                                               -\
  455.                          <A HREF="<??RxValidId>.<$HtmlExtension>#{$Target}">{$Text}</A> -\
  456.                      #endif                                                -\
  457.                  #endif
  458. #elseif
  459.        ;--- IPF version -----------------------------------------------------
  460.        #define   LinkTo                                                    \
  461.                  #evaluate ^^ ^<$RexxGenerateValidId ID={$ID={$Text}}>;<$HeadingIdReference>^ -\
  462.                  #if [RexxHeadingIdLastUsed = RxValidId]                  -\
  463.                      <$PlaySafe>{$Text}                                   -\
  464.                  #elseif                                                  -\
  465.                      :link reftype=hd refid=<??RxValidId>.{$Text}:elink.  -\
  466.                  #endif
  467. #endif
  468. #define LinkToRoutine <$LinkTo Id='{$Text}' Text='{$Text}()'>
  469.  
  470.  
  471. ;----------------------------------------------------------------------------
  472. ;--- INDEX ------------------------------------------------------------------
  473. ;----------------------------------------------------------------------------
  474. #if    ['<$DocType>' = 'IPF']
  475.        ;--- IPF -------------------------------------------------------------
  476.        #define Index1                                                             \
  477.                #evaluate ^^ ^<$RexxGenerateValidId ID={$ID={$Text=¡<??RexxHeadingLastUsed $$Sqx2>¡}}>^ -\
  478.                #RexxVar RexxLastIndex1Id = RxValidId                             -\
  479.                :i1 id=<??RxValidId>.{$Text=¡<??RexxHeadingLastUsed>¡}
  480.        #define Index2                                                             \
  481.                #evaluate ^^ ^<$RexxGenerateValidId ID={$Index1=<??RexxLastIndex1Id>}>^  -\
  482.                :i2 refid=<??RxValidId>.{$Text=¡<??RexxHeadingLastUsed>¡}
  483. #endif
  484. #if    ['<$DocType>' = 'HTML']
  485.        ;--- HTML ------------------------------------------------------------
  486.        #define Index1 <$WARNING_NOW_IPF_ONLY>
  487.        #define Index2 <$WARNING_NOW_IPF_ONLY>
  488. #endif
  489.  
  490.  
  491.  
  492.  
  493. ;----------------------------------------------------------------------------
  494. ;--- TITLE (Big Text in Highlight Color) ------------------------------------
  495. ;----------------------------------------------------------------------------
  496. #if    ['<$DocType>' = 'IPF']
  497.        ;--- IPF -------------------------------------------------------------
  498.        #define Title                                                     \
  499.                :p.:color fc={$Color="neutral"}.                         -\
  500.                :font facename={$Font="Helv size=24x24."}:hp7.           -\
  501.                {$Text=¡<??RexxHeadingLastUsed>¡}                        -\
  502.                :color fc=default.                                       -\
  503.                :font facename=default size=0x0.:ehp7.
  504. #endif
  505. #if    ['<$DocType>' = 'HTML']
  506.        ;--- HTML ------------------------------------------------------------
  507.        #define Title                                                     \
  508.                <H1><CENTER>{$Text=¡<??RexxHeadingLastUsed>¡}</CENTER></H1>
  509. #endif
  510.  
  511.  
  512.  
  513. ;----------------------------------------------------------------------------
  514. ;--- We must assign all images used in doco an alias (faster) ---------------
  515. ;----------------------------------------------------------------------------
  516. #ifndef OL_DOC_IMAGE_IPF_LOCAL
  517.         #define OL_DOC_IMAGE_IPF_LOCAL          ;;Location at "IPFC.EXE" time! Could also add dir to IPFC search path
  518. #endif
  519. #ifndef OL_DOC_IMAGE_HTML_LOCAL
  520.         #define OL_DOC_IMAGE_HTML_LOCAL    .\   ;;Location at "PPWIZARD" time!
  521. #endif
  522. #ifndef OL_DOC_IMAGE_HTML_REMOTE
  523.         #define OL_DOC_IMAGE_HTML_REMOTE        ;;Location at HTML "runtime"!
  524. #endif
  525. #DefineRexx "_SaveTaggedImageUnderAlias"
  526.             ;--- If we know where the file is add as dependancy -------------
  527.             #if   ['<$DocType>' = 'IPF']
  528.                   ;--- IPF List ---------------------------------------------
  529.                   Locfile = '<$OL_DOC_IMAGE_IPF_LOCAL>{$Image}.bmp';
  530.             #elseif
  531.                   ;--- HTML List --------------------------------------------
  532.                   Locfile = '<$OL_DOC_IMAGE_HTML_LOCAL>{$Image}.{$Type='gif'}';
  533.             #endif
  534.             LocfileFull = stream(Locfile, 'c', 'query exists');
  535.             if LocfileFull <> '' then
  536.                call AddInputFileToDependancyList LocfileFull;
  537.  
  538.             ;--- Save IMAGE tag information for bullet (do once to save time etc) ---
  539.             #if   ['<$DocType>' = 'IPF']
  540.                   ;--- IPF List ---------------------------------------------
  541.                   ToSave  = ":artwork runin name='" || Locfile || "'{$IPF=^^ $$SPCPLUS}.";
  542.             #elseif
  543.                   ;--- HTML List --------------------------------------------
  544.                   TmpSize = GetImageHeightWidth(Locfile);
  545.                   ToSave  = '<IMG SRC="<$OL_DOC_IMAGE_HTML_REMOTE>{$Image}.{$Type='gif'}" ' || TmpSize || '{$HTML=^^ $$SPCPLUS}>';
  546.             #endif
  547.             AliasVar =  'DIMG_' || c2x('{$ALIAS}');
  548.             call _valueS AliasVar, ToSave;
  549. #DefineRexx
  550. #DefineRexx "_RetrieveTaggedImageUsingAlias"
  551.            Alias    =  '{$Alias=^?^}';
  552.            AliasVar =  'DIMG_' || c2x(Alias);
  553.            if  symbol(AliasVar) <> 'VAR' then
  554.                error('Alias "' || Alias || '" is unknown, define with "DefineImage" macro!');
  555.            {$ResultVar} = _valueG(AliasVar);
  556. #DefineRexx
  557. #define     DefineImage     ;;Define Image                      \
  558.             #evaluate  ^^ ^<$_SaveTaggedImageUnderAlias {$?} LFILEVAR="DocImgFile">^
  559. #define     Image         ;;Use    Image                        \
  560.             #evaluate  ^^ ^<$_RetrieveTaggedImageUsingAlias Alias={$#1=^?^ $$AQ} RESULTVAR="DocImgTags">^ -\
  561.             <??DocImgTags>
  562.  
  563.  
  564. ;**      CommentBlock  /* (Thursday 02/12/1999, 10:35:06, by Dennis_Bareis) */
  565. ;**+--------------------------------------------------------------------------
  566. ;**|;----------------------------------------------------------------------------
  567. ;**|;--- GRAPHIC IMAGE MACROS ---------------------------------------------------
  568. ;**|;----------------------------------------------------------------------------
  569. ;**|#if    ['<$DocType>' = 'HTML']
  570. ;**|       ;--- HTML ------------------------------------------------------------
  571. ;**|       #define Image                                                       \
  572. ;**|               #evaluate+ TmpSize ^GetImageHeightWidth("<$OL_DOC_IMAGE_HTML_LOCAL>{$Image}.{$Type='gif'}")^  -\
  573. ;**|               <IMG SRC="<$OL_DOC_IMAGE_HTML_REMOTE>{$Image}.{$Type='gif'}" <$TmpSize>>
  574. ;**|#else
  575. ;**|       ;--- IPF -------------------------------------------------------------
  576. ;**|       #define Image                                                       \
  577. ;**|               :artwork runin name='<$OL_DOC_IMAGE_IPF_LOCAL>{$Image}.bmp'.
  578. ;**|#endif
  579. ;**+--------------------------------------------------------------------------
  580. ;**                    /* (Thursday 02/12/1999, 10:35:06, by Dennis_Bareis) */
  581.  
  582.  
  583.  
  584. ;----------------------------------------------------------------------------
  585. ;--- Define START of Lists --------------------------------------------------
  586. ;----------------------------------------------------------------------------
  587. #RexxVar       ListLevel  = 0              ;;Init List level (nesting level)
  588. #DefineRexx    ListStart
  589.    ;--- Increase List Level (save old Information) ---
  590.    if  ListLevel > 0 then
  591.    do
  592.        ;--- Save variables onto stack ---
  593.        ListMem.ListLevel.!LiCount = LiCount;  ;;Save list item count
  594.        ListMem.ListLevel.!LiB     = LiB;      ;;Save START List Item
  595.        ListMem.ListLevel.!LiA     = LiA;      ;;Save END   List Item
  596.        ListMem.ListLevel.!LiEnd   = LiEnd;    ;;Save End  List
  597.    end;
  598.    ListLevel = ListLevel + 1;
  599.  
  600.    ;--- Reset the List Item counter ---
  601.    LiCount = 0;
  602.  
  603.    ;--- Set up stuff ---------------------------------------------------
  604.    ListType = '{$ListType}';
  605.    select
  606.        /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  607.        when ListType = 'ORDLIST' | ListType = 'ORDLIST_C' then
  608.        /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  609.        do
  610.            ;--- Simple ordered list -----------------------------------------
  611.            #if    ['<$DocType>' = 'HTML']
  612.                   ;--- HTML List --------------------------------------------
  613.                   if ListType = 'ORDLIST' then
  614.                      LiB = '<P><LI>';              ;;Space out
  615.                   else
  616.                      LiB = '<LI>';                 ;;Compact!
  617.                   LiStart =  '<OL>';
  618.                   LiEnd   =  '</OL>';
  619.            #elseif
  620.                   ;--- IPF List ---------------------------------------------
  621.                   if ListType = 'ORDLIST' then
  622.                      LiStart = ':lm Margin=5.:ol.';          ;;Space out
  623.                   else
  624.                      LiStart = ':lm Margin=5.:ol compact.';  ;;Compact!
  625.                   LiB   =  ':li.';
  626.                   LiEnd =  ':eol.:lm Margin=1.';
  627.            #endif
  628.  
  629.            ;--- Both HTML + IPF ---------------------------------------------
  630.            LiA = '';
  631.        end;
  632.        /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  633.        when ListType = 'UNUMBLIST' | ListType = 'UNUMBLIST_C' then
  634.        /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  635.        do
  636.            ;--- Simple ordered list -----------------------------------------
  637.            #if    ['<$DocType>' = 'HTML']
  638.                   ;--- HTML List --------------------------------------------
  639.                   if ListType = 'UNUMBLIST' then
  640.                      LiB = '<P><LI>';              ;;Space out
  641.                   else
  642.                      LiB = '<LI>';                 ;;Compact!
  643.                   LiStart =  '<UL>';
  644.                   LiEnd   =  '</UL>';
  645.            #elseif
  646.                   ;--- IPF List ---------------------------------------------
  647.                   if ListType = 'UNUMBLIST' then
  648.                      LiStart = ':lm Margin=5.:ul.';          ;;Space out
  649.                   else
  650.                      LiStart = ':lm Margin=5.:ul compact.';  ;;Compact!
  651.                   LiB   =  ':li.';
  652.                   LiEnd =  ':eul.:lm Margin=1.';
  653.            #endif
  654.  
  655.            ;--- Both HTML + IPF ---------------------------------------------
  656.            LiA = '';
  657.        end;
  658.        /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  659.        when ListType = 'SIMPLELIST' | ListType = 'SIMPLELIST_C' then
  660.        /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  661.        do
  662.            ;--- Simple ordered list -----------------------------------------
  663.            #if    ['<$DocType>' = 'HTML']
  664.                   ;--- HTML List --------------------------------------------
  665.                   if ListType = 'SIMPLELIST' then
  666.                      LiB = '<P>';                            ;;Space out
  667.                   else
  668.                      LiB = '<BR>';                           ;;Compact!
  669.                   LiStart =  '<OL>';
  670.                   LiEnd   =  '</OL>';
  671.            #elseif
  672.                   ;--- IPF List ---------------------------------------------
  673.                   if ListType = 'SIMPLELIST' then
  674.                      LiStart = ':lm Margin=5.:sl.';          ;;Space out
  675.                   else
  676.                      LiStart = ':lm Margin=5.:sl compact.';  ;;Compact!
  677.                   LiB   =  ':li.';
  678.                   LiEnd =  ':esl.:lm Margin=1.';
  679.            #endif
  680.  
  681.            ;--- Both HTML + IPF ---------------------------------------------
  682.            LiA = '';
  683.        end;
  684.        /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  685.        when ListType = 'IMGLIST' | ListType = 'IMGLIST_C' then
  686.        /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  687.        do
  688.            ;--- Get IMG tags -------------------------------------------------
  689.            <$_RetrieveTaggedImageUsingAlias {$Alias=^^ $$PASSAQ} ResultVar="AliasImg">
  690.  
  691.            ;--- Simple ordered list -----------------------------------------
  692.            #if    ['<$DocType>' = 'HTML']
  693.                   ;--- HTML List --------------------------------------------
  694.                   if ListType = 'IMGLIST' then
  695.                      LiB = '<TR VALIGN="TOP"><TD>' || AliasImg || '</TD><TD>';     ;;Space out
  696.                   else
  697.                      LiB = '<TR VALIGN="TOP"><TD>' || AliasImg || '</TD><TD>';     ;;Compact!
  698.                   LiA     = '</TD></TR>';
  699.                   LiStart =  '<TABLE BORDER=0 CELLSPACING=10>';
  700.                   LiEnd   =  '</TABLE>';
  701.            #elseif
  702.                   ;--- IPF List ---------------------------------------------
  703.                   if ListType = 'IMGLIST' then
  704.                      LiStart = ':lm Margin=5.:dl compact tsize={$IMGSIZE=^1^}.';    ;;Space out
  705.                   else
  706.                      LiStart = ':lm Margin=5.:dl compact tsize={$IMGSIZE=^1^}.';    ;;Compact!
  707.                   LiB   =  ':dt.' || AliasImg || ':dd.';
  708.                   LiEnd =  ':edl.:lm Margin=1.';
  709.                   LiA = '';
  710.            #endif
  711.        end;
  712.        /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  713.        otherwise
  714.        /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  715.            error('Unknown list type of "' || ListType || '"');
  716.    end;
  717. #DefineRexx
  718. #define OrdList                                               \
  719.         #evaluate ^^ ^<$ListStart ListType="ORDLIST">^       -\
  720.         <??LiStart>
  721. #define OrdListCompact                                        \
  722.         #evaluate ^^ ^<$ListStart ListType="ORDLIST_C">^     -\
  723.         <??LiStart>
  724. #define UnNumberedList                                        \
  725.         #evaluate ^^ ^<$ListStart ListType="UNUMBLIST">^     -\
  726.         <??LiStart>
  727. #define UnNumberedListCompact                                 \
  728.         #evaluate ^^ ^<$ListStart ListType="UNUMBLIST_C">^   -\
  729.         <??LiStart>
  730. #define SimpleList                                            \
  731.         #evaluate ^^ ^<$ListStart ListType="SIMPLELIST">^    -\
  732.         <??LiStart>
  733. #define SimpleListCompact                                     \
  734.         #evaluate ^^ ^<$ListStart ListType="SIMPLELIST_C">^  -\
  735.         <??LiStart>
  736. #define ImgList                                                          \
  737.         #evaluate ^^ ^<$ListStart ListType="IMGLIST" ALIAS=^{$#1}^>^    -\
  738.         <??LiStart>
  739. #define ImgListCompact                                                   \
  740.         #evaluate ^^ ^<$ListStart ListType="IMGLIST_C" ALIAS=^{$#1}^>^  -\
  741.         <??LiStart>
  742.  
  743.  
  744.  
  745. ;----------------------------------------------------------------------------
  746. ;--- Define List Item Stuff -------------------------------------------------
  747. ;----------------------------------------------------------------------------
  748. #DefineRexx    ListItem
  749.                if  LiCount = 0 then
  750.                    LiThis  = LiB;           ;;Start new
  751.                else
  752.                    LiThis  = LiA || LiB;    ;;Finish old + start new
  753.                LiCount = LiCount + 1;
  754. #DefineRexx
  755. #define LI                                                  \
  756.         #evaluate ^^ ^<$ListItem>^                         -\
  757.         <??LiThis>
  758.  
  759.  
  760.  
  761. ;----------------------------------------------------------------------------
  762. ;--- Define END of Lists ----------------------------------------------------
  763. ;----------------------------------------------------------------------------
  764. #DefineRexx    ListEnd
  765.    ;--- Make sure we are in a list! -----------------------------------------
  766.    if  ListLevel < 1 then
  767.        error("Found End of List. We are not in one!");
  768.  
  769.    ;--- What do we need to generate to complete the list? -------------------
  770.    if  LiCount = 0 then
  771.        LiThis  = LiEnd;           ;;No list items so just end the list
  772.    else
  773.        LiThis  = LiA || LiEnd;    ;;Finish old item + finish list
  774.  
  775.    ;--- Restore information -------------------------------------------------
  776.    ListLevel = ListLevel - 1;
  777.    if  ListLevel > 0 then
  778.    do
  779.        LiCount   = ListMem.ListLevel.!LiCount;
  780.        LiB       = ListMem.ListLevel.!LiB;
  781.        LiA       = ListMem.ListLevel.!LiA;
  782.        LiEnd     = ListMem.ListLevel.!LiEnd;
  783.    end;
  784. #DefineRexx
  785. #define eAllLists                   \
  786.         #evaluate ^^ ^<$ListEnd>^  -\
  787.         <??LiThis>
  788. #define eOrdList                <$eAllLists>
  789. #define eOrdListCompact         <$eAllLists>
  790. #define eUnNumberedList         <$eAllLists>
  791. #define eUnNumberedListCompact  <$eAllLists>
  792. #define eSimpleList             <$eAllLists>
  793. #define eSimpleListCompact      <$eAllLists>
  794. #define eImgList                <$eAllLists>
  795. #define eImgListCompact         <$eAllLists>
  796.  
  797.  
  798. ;----------------------------------------------------------------------------
  799. ;--- SIMPLE CONDITIONAL INCLUSION (only use for non-important formatting!) --
  800. ;----------------------------------------------------------------------------
  801. #if    ['<$DocType>' = 'HTML']
  802.        ;--- HTML ------------------------------------------------------------
  803.        #define HTML    {$#1}
  804.        #define IPF
  805. #else
  806.        ;--- IPF -------------------------------------------------------------
  807.        #define IPF     {$#1}
  808.        #define HTML
  809. #endif
  810.  
  811.  
  812.  
  813. ;----------------------------------------------------------------------------
  814. ;--- COMMENT RELATED MACROS -------------------------------------------------
  815. ;----------------------------------------------------------------------------
  816. #if    ['<$DocType>' = 'HTML']
  817.        ;--- HTML ------------------------------------------------------------
  818.        #define  Comment        <!-- {$#1} -->
  819. #elseif
  820.        ;--- IPF -------------------------------------------------------------
  821.        #define  Comment        .*-- {$#1} ---
  822. #endif
  823. #define    DComment                     \
  824.            #if ['<?DebugOn>' = 'Y']    -\
  825.                <$Comment ={$#1 $$AQ}>  -\
  826.            #endif
  827.  
  828.  
  829. ;----------------------------------------------------------------------------
  830. ;--- TABLE Support ----------------------------------------------------------
  831. ;----------------------------------------------------------------------------
  832. #ifndef    OL_DOC_IPF_TABLE        ;;Allows you to define extra IPF TABLE tags
  833.    #define OL_DOC_IPF_TABLE
  834. #endif
  835. #ifndef    OL_DOC_IPF_TH_ATTRIB    ;;Allows you to define how IPF table headers are formatted (don't use BOLD!)
  836.    #define OL_DOC_IPF_TH_ATTRIB    :hp9.{$#1}:ehp9.    ;;Magenta by default
  837. #endif
  838. #ifndef    OL_DOC_HTML_TABLE       ;;Allows you to define extra TABLE tags
  839.    #define OL_DOC_HTML_TABLE
  840. #endif
  841. #ifndef    OL_DOC_HTML_TR          ;;Allows you to define extra TR tags
  842.    #define OL_DOC_HTML_TR
  843. #endif
  844. #ifndef    OL_DOC_HTML_TH          ;;Allows you to define extra TH tags
  845.    #define OL_DOC_HTML_TH
  846. #endif
  847. #ifndef    OL_DOC_HTML_TC          ;;Allows you to define extra TC (html TD) tags
  848.    #define OL_DOC_HTML_TC
  849. #endif
  850. #if    ['<$DocType>' = 'IPF']
  851.        ;--- IPF -------------------------------------------------------------
  852.        #define Table                                      \
  853.                :table cols='{$WIDTHS}'                   -\
  854.                #if ["{$BORDER=''}" = ""]                 -\
  855.                    <?Space>rules=none frame=none         -\
  856.                #endif                                    -\
  857.                <$OL_DOC_IPF_TABLE $$SPCPLUS>             -\
  858.                .
  859.        #define eTable       :eTable.
  860.        #define TR           :row.
  861.        #define eTR
  862.        #define TH           :c.<$OL_DOC_IPF_TH_ATTRIB ={$#1 $$AQ}>
  863.        #define TC           :c.
  864.        #define eTD
  865. #else
  866.        ;--- HTML ------------------------------------------------------------
  867.        #DefineRexx SaveHtmlWidths
  868.               ;--- Want to die if invalid column used! ------------
  869.               drop HtmlWidth.
  870.  
  871.               ;--- Work out total width (so we can calculate %) ---
  872.               TblColCount   = words(ColWidths);
  873.               ColWidthTotal = 0;
  874.               do i = 1 to TblColCount
  875.                  ColWidthTotal = ColWidthTotal + word(ColWidths, i);
  876.               end
  877.  
  878.               ;--- Now save each width as percentage of total -----
  879.               TotalPercent = 0;
  880.               do i = 1 to TblColCount
  881.                  if i = TblColCount then
  882.                     ThisPercent = 100 - TotalPercent;   ;;Left overs!
  883.                  else
  884.                  do
  885.                     ;--- Not the last column! ---------------------
  886.                     ThisPercent = (word(ColWidths, i) * 100) % ColWidthTotal;
  887.                     TotalPercent = TotalPercent + ThisPercent;
  888.                  end;
  889.                  HtmlWidth.i = ThisPercent || '%';
  890.               end
  891.        #DefineRexx
  892.        #define Table                                      \
  893.                #RexxVar ColWidths = ^{$Widths}^          -\
  894.                #evaluate ^^ ^<$SaveHtmlWidths>^          -\
  895.                <TABLE                                    -\
  896.                #if ["{$BORDER=''}" <> ""]                -\
  897.                    <?Space>BORDER=1                      -\
  898.                #endif                                    -\
  899.                <$OL_DOC_HTML_TABLE $$SPCPLUS>            -\
  900.                >
  901.        #define eTable   </TABLE>
  902.        #define TR                                         \
  903.                <TR<$OL_DOC_HTML_TR $$SPCPLUS>>           -\
  904.                #RexxVar ColumnCount = 0
  905.        #define eTR          </TR>
  906.        #define TH                                         \
  907.                #RexxVar ColumnCount + 1                  -\
  908.                <TH WIDTH="<??HtmlWidth.ColumnCount>"     -\
  909.                    <$OL_DOC_HTML_TH $$SPCPLUS>           -\
  910.                >                                         -\
  911.                    {$#1}                                 -\
  912.                </TH>
  913.        #define TC                                         \
  914.                #RexxVar ColumnCount + 1                  -\
  915.                <TD WIDTH="<??HtmlWidth.ColumnCount>"     -\
  916.                    <$OL_DOC_HTML_TC $$SPCPLUS>           -\
  917.                >
  918.        #define eTC          </TD>
  919. #endif
  920.  
  921.  
  922. ;----------------------------------------------------------------------------
  923. ;--- References to Internet HTML pages --------------------------------------
  924. ;----------------------------------------------------------------------------
  925. #if    ['<$DocType>' = 'IPF']
  926.        ;--- IPF -------------------------------------------------------------
  927.        #define HtmlPage        <$DarkGreen Text=^http<$colon>//{$Page}^>
  928. #elseif
  929.        ;--- HTML ------------------------------------------------------------
  930.        #ifndef OL_DOC_HTML_TARGET
  931.               #define HtmlPage <A HREF="http://{$Page}">http://{$Page}</A>
  932.        #elseif
  933.               #define HtmlPage <A HREF="http://{$Page}" TARGET="<$OL_DOC_HTML_TARGET>">http://{$Page}</A>
  934.        #endif
  935. #endif
  936.  
  937.  
  938.  
  939. ;----------------------------------------------------------------------------
  940. ;--- References to Internet Newsgroups --------------------------------------
  941. ;----------------------------------------------------------------------------
  942. #if    ['<$DocType>' = 'IPF']
  943.        #define NewsGroup        <$DarkGreen Text=^{$Group}^>          ;;IPF
  944. #elseif
  945.        #define NewsGroup        <A HREF="news:{$Group}">{$Group}</A>  ;;HTML
  946. #endif
  947.  
  948.  
  949.  
  950. ;----------------------------------------------------------------------------
  951. ;--- References to EMAIL ADDRESSES ------------------------------------------
  952. ;----------------------------------------------------------------------------
  953. #DefineRexx REXX_$$FIX_EMAIL_SUBJECT
  954.             ;--- The value is not allowed to contain spaces -----------------
  955.             TheValue = ReplaceString(TheValue, ' ', '%20');
  956. #DefineRexx
  957. #if    ['<$DocType>' = 'IPF']
  958.        #define EmailAddress        <$DarkGreen Text=^{$Email}^>            ;;IPF
  959.        #define EmailAddressSubject <$DarkGreen Text=^{$Email}^>
  960. #elseif
  961.        #define EmailAddress        <A HREF="mailto:{$Email}">{$Email}</A>  ;;HTML
  962.        #define EmailAddressSubject <A HREF="mailto:{$Email}?subject={$Subject $$FIX_EMAIL_SUBJECT}">{$Email}</A>
  963. #endif
  964.  
  965.  
  966.  
  967. ;----------------------------------------------------------------------------
  968. ;--- EXAMPLE (DO ALL YOUR OWN TAGGING - special symbols like colons as well)-
  969. ;----------------------------------------------------------------------------
  970. #if    ['<$DocType>' = 'IPF']
  971.        ;--- IPF -------------------------------------------------------------
  972.        #ifndef  PRE_COLOR_IPF
  973.                 #define PRE_COLOR_IPF       darkred
  974.        #endif
  975.        #define ExampleFormatted                                               \
  976.                :xmp.                                    ;;Start Example      -\
  977.                :color fc=<$PRE_COLOR_IPF>.                                   -\
  978.                :font facename='Courier' size=8x8.       ;;Small Mono Font
  979.        #define eExampleFormatted                                              \
  980.                :font facename=default size=0x0.         ;;Restore Font       -\
  981.                :color fc=default.                                            -\
  982.                :exmp.                                   ;;End of Example
  983. #endif
  984. #if    ['<$DocType>' = 'HTML']
  985.        #ifndef  PRE_COLOR_HTML
  986.                 ;--- Orange is default - looks good against black text and on white background ---
  987.                 #define PRE_COLOR_HTML       #FF6600
  988.        #endif
  989.        #ifndef  PRE_STYLE_OTHER_HTML
  990.                 ;--- Default style is to scale font down a bit --------------
  991.                 #define PRE_STYLE_OTHER_HTML ;font-size:80%
  992.        #endif
  993.        ;--- HTML ------------------------------------------------------------
  994.        #define ExampleFormatted                                                                              \
  995.                <FONT COLOR=<$PRE_COLOR_HTML>>                               ;;Set up font (older browsers)  -\
  996.                <PRE STYLE="color:<$PRE_COLOR_HTML><$PRE_STYLE_OTHER_HTML>"> ;;Start Example
  997.        #define eExampleFormatted                                                                             \
  998.                </PRE>                                                       ;;End of Example                -\
  999.                </FONT>                                                      ;;Restore Font (older browsers)
  1000. #endif
  1001.  
  1002. ;----------------------------------------------------------------------------
  1003. ;--- ALLOW SPELL CHECKING IN EXAMPLES? --------------------------------------
  1004. ;----------------------------------------------------------------------------
  1005. #ifndef PRE_SPELL_CHECKING
  1006.         #define PRE_SPELL_CHECKING OFF
  1007. #endif
  1008.  
  1009.  
  1010. ;----------------------------------------------------------------------------
  1011. ;--- EXAMPLE (NO TAGGING - EXCEPT AUTOTAGGING ALLOWED) ----------------------
  1012. ;----------------------------------------------------------------------------
  1013. #define Example                                                            \
  1014.         <$ExampleFormatted>                                               -\
  1015.         #AutoTagState  +     {$STATE=''}      ;;User can set up own tags  -\
  1016.         #option        PUSH AllowSpell={$SPELL="<$PRE_SPELL_CHECKING>"} ExtraIndent=^copies(' ', {$Indent='4'})^ -\
  1017.         #option        PUSH replace=OFF                                   -\
  1018.         #AutoTag       '<?xLT>$eExample<?xGT>'  '<$eExample>'   #1        -\
  1019.         #option        POP                 ;;Restore REPLACE mode         -\
  1020.         #AutoTag       ON                                                 -\
  1021.         #AsIs          ON ASIS_OL_DOC {$ASIS=''}
  1022. #define eExample                                                           \
  1023.         #AsIs          OFF                                                -\
  1024.         #option        POP                                                -\
  1025.         #AutoTagState  -                                                  -\
  1026.         <$eExampleFormatted>
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032. ;----------------------------------------------------------------------------
  1033. ;--- EXAMPLE FILE INCLUSION -------------------------------------------------
  1034. ;----------------------------------------------------------------------------
  1035. #define ExampleFile                                                        \
  1036.         <$ExampleFormatted>                                               -\
  1037.         #AutoTagState  +     {$STATE=''}      ;;User can set up own tags  -\
  1038.         #option        PUSH AllowSpell={$SPELL="<$PRE_SPELL_CHECKING>"} ExtraIndent=^copies(' ', {$Indent='4'})^ -\
  1039.         #AutoTag       ON                                                 -\
  1040.         #AsIs          ON ASIS_OL_DOC {$ASIS=''}                          -\
  1041.         #include       "{$File}" "{$Fragment=''}"                         -\
  1042.         #AsIs          OFF                                                -\
  1043.         #option        POP                                                -\
  1044.         #AutoTagState  -                                                  -\
  1045.         <$eExampleFormatted>
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052. ;----------------------------------------------------------------------------
  1053. ;--- Define LINKS between HTML pages ----------------------------------------
  1054. ;----------------------------------------------------------------------------
  1055. #if    ['<$DocType>' = 'HTML']
  1056.        ;--- Define macro to rebuild files from binary representation --------
  1057.        #define RebuildFile                                                                                                                                     \
  1058.                #if ['{$KeepCase='N'}' = 'N']                                                                                                                  -\
  1059.                    #evaluate ""  ^NewFile = EnsureFileHasCorrectCase(_filespec('drive', '<?OutputFile>') || _filespec('path', '<?OutputFile>') || '{$FILE}')^ -\
  1060.                #elseif                                                                                                                                        -\
  1061.                    #evaluate ""  ^NewFile = _filespec('drive', '<?OutputFile>') || _filespec('path', '<?OutputFile>') || '{$FILE}'^                           -\
  1062.                #endif                                                                                                                                         -\
  1063.                #DependsOn OUTPUT "<??NewFile>"                                                                                                                -\
  1064.                #evaluate ""  ^CloseRc = stream(NewFile, 'c', 'close');^                                                                                       -\
  1065.                #if stream(NewFile, 'c', 'query exists') <> ''                                                                                                 -\
  1066.                    #evaluate ""  ^DelRc = _SysFileDelete(NewFile)^                                                                                            -\
  1067.                    #if  stream(NewFile, 'c', 'query exists') <> ''                                                                                            -\
  1068.                         #evaluate ""  ^CloseRc = stream(NewFile, 'c', 'close');^                                                                              -\
  1069.                         #error ^Could not delete "<??NewFile>" (is it in use?)^                                                                               -\
  1070.                    #endif                                                                                                                                     -\
  1071.                #endif                                                                                                                                         -\
  1072.                #evaluate ""  ^WriteRc = charout(NewFile, NewFileData)^                                                                                        -\
  1073.                #evaluate ""  ^CloseRc = stream(NewFile, 'c', 'close');^                                                                                       -\
  1074.                #if  [WriteRc <> 0]                                                                                                                            -\
  1075.                     #error ^Could not write to "<??NewFile>"^                                                                                                 -\
  1076.                #endif
  1077.  
  1078.        ;--- Allow user to define OPTIONAL buttons ---------------------------
  1079.        #ifndef OL_DOC_HTML_SEARCH
  1080.                #define    OL_DOC_HTML_SEARCH                                 ;;Do nothing
  1081.        #elseif
  1082.                #evaluate+ OL_DOC_HTML_SEARCH   ^'<TD><$OL_DOC_HTML_SEARCH>'^ ;;Want in own table cell
  1083.        #endif
  1084.        #ifndef OL_DOC_HTML_HOME
  1085.                #define   OL_DOC_HTML_HOME                                    ;;Do nothing
  1086.        #elseif
  1087.                #evaluate OL_DOC_HTML_HOME     ^'<TD><$OL_DOC_HTML_HOME>'^    ;;Want in own table cell
  1088.        #endif
  1089.  
  1090.        ;--- Defile "PREV" details -------------------------------------------
  1091.        #ifndef OL_DOC_HTML_PREV
  1092.                ;--- Define the link -----------------------------------------
  1093.                #define OL_DOC_HTML_PREV   <A HREF="{$Page}.<??HtmlExtn>"><IMG SRC="prev.gif" BORDER=0 WIDTH=49 HEIGHT=31 ALT="[Prev]: {$Title}"></A>
  1094.  
  1095.                ;--- Create the graphic --------------------------------------
  1096.                #DefineRexx ""
  1097.                            NewFileData =                "47494638396132002600B3000000262600525200989801B8B800EDED78E0E0C8D8D878979768F8F800000000000000000000000000000000000000000021FF0B4E45545343415045322E300301000000"x
  1098.                            NewFileData = NewFileData || "21F90409030008002C00000900310016000004EA10C949D1A938EBCD650917671C64699E66470D01106686D002746DDF81A17A8240EB99426F482C0E03821DC230E8B55E9498714ACC2985434020D3A4"x
  1099.                            NewFileData = NewFileData || "5241D7220D83F51AC1BB721650919ACF40D10129CE19EECC773100C2C7A3327C7C37845A823385895A074031488F3238877C3281939798828C0605040304A0A082000203A6A7A1A0A7ABACADA7050513"x
  1100.                            NewFileData = NewFileData || "06A1A79601ADAA9FAEAD02049DBF7FB2A07B5A7EB39E7A595022C3445A6DCDC92DC11BC7CE5B159D5DC9C54AB35D4F19D1DCCBCC4DE118D6C991E51B9D81D41EC8EBD3DE0432F112C7BBBB324A4B03DA"x
  1101.                            NewFileData = NewFileData || "458145B0A04183F960FC5B8821020021F90409030008002C00000A00300015000004E310C949A5A938EBCD9109D7668C6469965D7500E07604702CCF0170A4D35BDF994EFF319C4710030042940FCCC8"x
  1102.                            NewFileData = NewFileData || "6C3A59B0C3A1804C1288CB63C520101006E0B0784C1E542D846B514B3978BFE5B898BA2DA4BF6BD5E00E9793096706057B7760355032846984608B8C8C7449768A7D03015D985D858C858E8B91758502"x
  1103.                            NewFileData = NewFileData || "63017E44A3A503A7AA862D22775845A96278403F2C6718766A32465593B6B7AEAFBC873C13067BB1C145B91806B5C6BAD1CC32387658BE19C0D545C7AF9646011AD0AADDDE29D058CE12937E6501DF1A"x
  1104.                            NewFileData = NewFileData || "E6EC1383EF6502F51602F219270003EEB320A4A086080021F90409030008002C00000A00300012000004CD10C9398DA138EBCD350957871845699E681A6AC507760621CC746DDBC78AC5EEBB1184C16D"x
  1105.                            NewFileData = NewFileData || "88EB008581A46ED23A0E9ED0A87470E8349F820000B0E405055041F0391E7C0B30E7530BA85680E56F1C3A5E5248E428DB2D8163E57F7442761278535801374E62426173038423523789445900899897"x
  1106.                            NewFileData = NewFileData || "99493E1A86585BA29A436CA3A7A37C1C0561A801072788A8B35B9E1B86A6A2AA064297B4B391148DB96D180560BEBFA73930A1B5B612C74859D489D6D5D4C1926C5991C796E002681C035AB0E31BBDE1"x
  1107.                            NewFileData = NewFileData || "44CC9FED22F0F0110021F90409030008002C00000800310016000004FE10C94991A938EBCD65395D2872C600805C11AC6CEBBA575798409C95C2ABC361390480C06636281A8FC841CEB6F11501B50C51"x
  1108.                            NewFileData = NewFileData || "691414ADD72A4A76046E274EAA121BB8620502D1F41AC44C03567476BE0C15B0D536C529FF99FF75246348390107878747677F833F414C7B07396893703B94402B41409B9B9A5F7B68963950A53B96A5"x
  1109.                            NewFileData = NewFileData || "A9AAA68790123EA2A4A994B495A72E9E8637050493AA563333044A96B7B7AE16339C4150150604C385C6A707C8CF2B564090BC49DDDE0405C860C345DACED03F71657E83027A2308DC3F4218CFC4E564"x
  1110.                            NewFileData = NewFileData || "F84A27F012D1BA52A22D6A44260ABC6BA0F6A0F34668453F040402887B55A0A2C58B182D4EBCB1F1E18608003B"x
  1111.                #DefineRexx
  1112.                <$RebuildFile FILE="prev.gif">
  1113.        #endif
  1114.        #ifndef OL_DOC_HTML_NEXT
  1115.                ;--- Define the link -----------------------------------------
  1116.                #define OL_DOC_HTML_NEXT   <A HREF="{$Page}.<??HtmlExtn>"><IMG SRC="next.gif" BORDER=0 WIDTH=49 HEIGHT=31 ALT="[Next]: {$Title}"></A>
  1117.  
  1118.                ;--- Create the graphic --------------------------------------
  1119.                #DefineRexx ""
  1120.                            NewFileData =                "47494638396132002600B3000000262600525200989801B8B800EDED78E0E0C8D8D878979768F8F800000000000000000000000000000000000000000021FF0B4E45545343415045322E300301000000"x
  1121.                            NewFileData = NewFileData || "21F90409030008002C01000700310016000004E710C949ABBD18996C4DF96028861B770C253705C2E0BE703C1044DAB1B53A19002BFCC0607056C01802B8A24E72E8099F419A6DD264CDA62600742BA0"x
  1122.                            NewFileData = NewFileData || "5D9AC0EB5213D07285444B399A5BF27C67A0B4B2666331E078586AE81F9D76171E030584033F3232042E343248482D8C73121F89968A348D31023D48998D04057D078FA5A6A7A5022CABA600AEAEABAA"x
  1123.                            NewFileData = NewFileData || "B22506A4AFB7B8B9ADB9B8A602777EB5707A88C17F5007771547C3C453AE4F4A3AA4C441D213D041CA16D4D58817753FD71C47DE407755C563DDDEE33BD9EE4665BCF42CDB5503630807FCFDFEFFFEB6"x
  1124.                            NewFileData = NewFileData || "3109104F9FC10C075444000021F90409030008002C02000700300015000004E210C949ABBD18993C8DFF60286E1C520864760E6CEBBE6E511A8120978700EF2F715F34808090CA1C0081A472C9AC0D88"x
  1125.                            NewFileData = NewFileData || "980000F92C628ECDACF2F9A318A6C96137A32D07B8962332592D69D6E6A50E4A512B87F44C30CE4477C072043E33527C4B4F3085818256153467033A024E0367933A3C952F9882058D1A054F042C82A2"x
  1126.                            NewFileData = NewFileData || "A3A5A602AAAB932E82A53E5606A1A8B5A3A2A6A34D60A4AF039E8EB79930AFA307158067AFC05EA1C3998202C75EC9788D06CFCF0493B2D579CD07074A53E4E5E670D7D59F17864CD3696BEF6E58ED01"x
  1127.                            NewFileData = NewFileData || "F28E52F73323FC1F1C34EBDC0814187042040021F90409030008002C02000A00300012000004D110C949ABBD189963F01660288E649121457100819915642CBB96110800200C5D6608B7207028140E04"x
  1128.                            NewFileData = NewFileData || "B4892D90D30D78A74D734A9DDE7649C4CA7ACC5E0AD570F30A9D6CB98342CFC714576FCF94BC3DDDC54F92B37B2CA337ED716B3501843A4C844C402C322045404F908214064F049004803B9895982370"x
  1129.                            NewFileData = NewFileData || "90A069924A9A97769B9B0304AB145B01A0ABA23E9597A6AA97AB82AEB804A31430B7B49599AAB91506399FAB5EADA1CECEAB04CC4B37D127078C8CC56C84C6171FD98CBD514CD23E72E8E9EA72BEC701"x
  1130.                            NewFileData = NewFileData || "0478F1F251ED08110021F90409030008002C01000800310016000004FF10C949ABBDD8189C8BFF60F86D9C11101C1604C2E0BE304C10E4759C753A1940E0B6030170D8221430B7A2CE7200B404BE012B"x
  1131.                            NewFileData = NewFileData || "189DD22E2B977159093883C0EAD337CB2178D1C1B55488B9DFB223054DC55D0CB7957ECFEF5BD713003D823D03056612057E8B7D504586900284824202468808798C8B8E2C9595933D8E4598784DA1A8"x
  1132.                            NewFileData = NewFileData || "932C8CA1ABA398993D7AA2822BB2A2429CAEB90207B02685603F43C32F07C7C77A314203B03B5341C552D2CD5D5F3002722926442E51CCCC2F165E402FDA2907DDD1C2D32F884D692E5CE9C43FF6F786"x
  1133.                            NewFileData = NewFileData || "17058230CE138AE5E0B839672D8A3F092636F969E18C0700793A122AF44390C9C3835C3222A9A8B1E3361D110100003B"x
  1134.                #DefineRexx
  1135.                <$RebuildFile FILE="next.gif">
  1136.        #endif
  1137.        #ifndef OL_DOC_HTML_TOP
  1138.                ;--- Define the link -----------------------------------------
  1139.                #define OL_DOC_HTML_TOP    <A HREF="#TOP"><IMG SRC="top.gif" BORDER=0 WIDTH=30 HEIGHT=30 ALT="[Top]"></A>
  1140.  
  1141.                ;--- Create the graphic --------------------------------------
  1142.                #DefineRexx ""
  1143.                            NewFileData =                "4749463839611E001E00FE0000C0C0C0080031F7180800C66BEFDE008C00A531FFFF7384000042A5DE6B6B00DED673A573FF3939FFFFFF8C00738C0800009CD6006318006BBDA5FFFF29BD299CD618C6"x
  1144.                            NewFileData = NewFileData || "EF0839009408005AFF8C0000299473CEB5F74208BDB5637BC621520042FF5A5A39949C52CE21A5429400C68C42427B001084FFADADFFB500944A00FF6300297B423900636BFFE700D6ADC600AD00B531"x
  1145.                            NewFileData = NewFileData || "FFD6D6DEC600A529296B006394842910008C008C94001863CE94ADDE5A0073397B4AA58C4A6B08FF5252FF8C8C94398400844A310042B5000000B552219C7B00316B4AFFCEDE10086B8429BD73636300"x
  1146.                            NewFileData = NewFileData || "A584FFFF39638C006B9C21CE9C00104294CEC6C6FFFFD63100ADC61029631063BD9C948C0063004A4AAD2110D6BD00947300BD4ABD946300ADBD008CB500427BA50084DE7B7B846300942929BDD62184"x
  1147.                            NewFileData = NewFileData || "21008CAD6B5A005A18AD390073424A8410FFE7E708B5D6DEFFFF08AD8C94007B00294A6BBD1818D6D642397318B55A08AD397BC6A500317B1094BDFF4A4A633973009C9400521863A57300000021F904"x
  1148.                            NewFileData = NewFileData || "01000000002C000000001E001E004007FE800082838485398588898274010150382691929138381850188A887D1111309FA09F6976767E9A8866A91CABACAD534AA78A1F1F586161700E0E23B1824E37"x
  1149.                            NewFileData = NewFileData || "376D6D5E0AC4C5C6C406525206C221A73D070716D3D4D36554541DBC8348020CDFE0E0203F0D09DB89405834BAE7887B0142422C4BF44B2CF7F7DB4D50717808FF0003FEC363A46093423C7858599850"x
  1150.                            NewFileData = NewFileData || "4D902024224A8CF8E4488B28513668B4C24353958F22428A149925CB99766352A258C972A58C975DDA3D183284811E1F38718238014200AC7685D4ED028A6ED6BA5C0E881202F2010D8D172F70E51ADA"x
  1151.                            NewFileData = NewFileData || "AE91BC0B58B3DEC380A1C436478F34881D4B164F251C5E133529E8E4CB17087C70E3CA959BC789DD4221F8789933470B1FBDC78C1998D0C08D1B294CB43853A4A6F180C7901F1779F2E44EBB2A9D2868"x
  1152.                            NewFileData = NewFileData || "DEAC398DE605ED7A40AB40BA74690F544E9E8B768580EBD7AECB4CD3762E85ED0CB873E7D6A123E6B9073305081F2E5C0F03243FB70DE9162E9C18366CCC9D53A22481F5EBD8C58839912810003B"x
  1153.                #DefineRexx
  1154.                <$RebuildFile FILE="top.gif">
  1155.        #endif
  1156.        #ifndef OL_DOC_HTML_BOTTOM
  1157.                ;--- Define the link -----------------------------------------
  1158.                #define OL_DOC_HTML_BOTTOM <A HREF="#BOTTOM"><IMG SRC="bottom.gif" BORDER=0 WIDTH=30 HEIGHT=30 ALT="[Bottom]"></A>
  1159.  
  1160.                ;--- Create the graphic --------------------------------------
  1161.                #DefineRexx ""
  1162.                            NewFileData =                "4749463839611E001E00FE0000C0C0C0080031F7180800C66BEFDE008C00A531FFFF7384000042A5DE6B6B00DED673A573FF3939FFFFFF8C00738C0800009CD6006318006BBDA5FFFF29BD299CD618C6"x
  1163.                            NewFileData = NewFileData || "EF0839009408005AFF8C0000299473CEB5F74208BDB5637BC621520042FF5A5A39949C52CE21A5429400C68C42427B001084FFADADFFB500944A00FF6300297B423900636BFFE700D6ADC600AD00B531"x
  1164.                            NewFileData = NewFileData || "FFD6D6DEC600A529296B006394842910008C008C94001863CE94ADDE5A0073397B4AA58C4A6B08FF5252FF8C8C94398400844A310042B5000000B552219C7B00316B4AFFCEDE10086B8429BD73636300"x
  1165.                            NewFileData = NewFileData || "A584FFFF39638C006B9C21CE9C00104294CEC6C6FFFFD63100ADC61029631063BD9C948C0063004A4AAD2110D6BD00947300BD4ABD946300ADBD008CB500427BA50084DE7B7B846300942929BDD62184"x
  1166.                            NewFileData = NewFileData || "21008CAD6B5A005A18AD390073424A8410FFE7E708B5D6DEFFFF08AD8C94007B00294A6BBD1818D6D642397318B55A08AD397BC6A500317B1094BDFF4A4A633973009C9400521863A57300000021F904"x
  1167.                            NewFileData = NewFileData || "01000000002C000000001E001E004007FE80008283824A4A0988898A626227848F90070757049596956516161D9083217C5E73735A7CA00AA7A8A806130D6E6E524C5A219D84401F68342F2F700EBD23"x
  1168.                            NewFileData = NewFileData || "B4C00F0F4302C5C6C57A0C484AC09055111114D2D3D269D20BCD83015050381ADFE0E17838E425D9B45834BFE7B44348020CF1F2F1626C6C09EC8229FB19FDFEFE3A7474C907A0478F0315122A54E881"x
  1169.                            NewFileData = NewFileData || "CA19826A220E9848716291274FEE346B62C488932F5F20881C4992641E2728B305082084C585973059B0C080C11C4141B63ED0E8D5EBE6A077F38282F8D1005FBE614318E8F1C194298813200430CB67"x
  1170.                            NewFileData = NewFileData || "A62A87AB58B34E99CA6E8C571460C38295417660BE830734A9555B860A154E80F9AAC81541B76EDD2C591EE6EB030D86DFBF7ED3D8B1E387160F1E56121F5613240889C7901F3F39D2224A940D98ADF0"x
  1171.                            NewFileData = NewFileData || "20E4E4C68D366DBCA41AAD4A8A1403A167416A02250E1E04B063CB868DA7A39126CDE8ACEC66A2B7EFDEE43040C1906F0FCB964B922F91C9DCA7A00F1FB08409C3CBC13AE78380A4B38E9D568E7C8100"x
  1172.                            NewFileData = NewFileData || "003B"x
  1173.                #DefineRexx
  1174.                <$RebuildFile FILE="bottom.gif">
  1175.        #endif
  1176.        #ifndef OL_DOC_HTML_CONTENTS
  1177.                ;--- Define the link -----------------------------------------
  1178.                #define OL_DOC_HTML_CONTENTS <A HREF="<??ContentsId>.<??HtmlExtn>"><IMG SRC="contents.gif" BORDER=0 WIDTH=63 HEIGHT=37 ALT="[Contents]"></A>
  1179.  
  1180.                ;--- Create the graphic --------------------------------------
  1181.                #DefineRexx ""
  1182.                            NewFileData =                "4749463839613F002500B30800000000800000008000808000000080800080008080808080C0C0C0FF000000FF00FFFF000000FFFF00FF00FFFFFFFFFF21F90401000008002C000000003F0025000004"x
  1183.                            NewFileData = NewFileData || "FF10C949ABAD20EB7CBBFF6097296449021E17AE2C60BEA7A53D286B8B2EFC6EF343D737890AB7D96976BEA412181C5236C95C09B0442A253EA68DEACC28B356B0A9764094A34DEF0FFAA521B1D2581B"x
  1184.                            NewFileData = NewFileData || "BD55CFDB7105351A4E9E7F5B087B771207593C76797B154B2B8873658677876E630F58774E388282979166085F66732396A1A29259201CAC9313939553578C5F5A18AC828349AFBB147CB23EA0B0AA1D"x
  1185.                            NewFileData = NewFileData || "09282A839FA8789697A7C351B608C6B942B0A3A4C098D0B5B6D49C07BAC1859963BACA84DD15C6C7B983DB3EA9BF27EF779F7F741409D4ED76BDCF7FE2CC80E76B922609DFFABDC3872F961E1A4A2241"x
  1186.                            NewFileData = NewFileData || "63A5411FBF6AFEE23D9BF750D7468364C22AEA6B87F1DD466C8F207A1A56B1CCC1699C6A509C038F54B06E3C9E1CCBB06FC2BE762E8578FC1865893891B7B400E8E9F362B55CBB48B948645486C83282"x
  1187.                            NewFileData = NewFileData || "F625B0C04F265671B5ACA8A198738206ADC5BA0A318B33CF892C6B1021D2BAF54342B3D6D698D5219727DDBF7557FC5CCBA9D341B77D9906B99050A63BA145C614984C99E7620F680BC77C9C8B9D9EA5"x
  1188.                            NewFileData = NewFileData || "940B9CBD0CC258509764973245F1738362D2697756AC9879DD5FD8821B73A08BBBB7ED0DD35EFB1E1E3CB870E2C46B230F1201003B"x
  1189.                #DefineRexx
  1190.                <$RebuildFile FILE="contents.gif">
  1191.        #endif
  1192.        #ifdef  OL_DOC_HTML_GENERATE_SEARCH_ICON
  1193.                ;--- Create the graphic --------------------------------------
  1194.                #DefineRexx ""
  1195.                            NewFileData =                "4749463839613B002800C40A0000000080000000800080800000008080008000808080808004040404649CBFC3C534CCCC6464640D646404046464349C64C3FC"x
  1196.                            NewFileData = NewFileData || "9CCBFC34343464A0C5043434344A9C3433646464A1C0C0C0FF000000FF00FFFF000000FFFF00FF00FFFFFFFFFF21F9040100000A002C000000003B0028004005"x
  1197.                            NewFileData = NewFileData || "FFA0228E64699E68AAAA4B12414A34C99332DDF8754D57D5FB9547055891FC7ABB9B2C9268209E4F536B86B9ED7416DF0D78B578BD158B6498CD4A8448DFAE09"x
  1198.                            NewFileData = NewFileData || "8D965AB1F8D256C5D5ECD6B40E6FAF46626C6D52093132081208334E4F0D633113080D90860D8650118D11869A9A81502BA0A1A2A32D3037753F755661AC5F60"x
  1199.                            NewFileData = NewFileData || "65653F4068379E6E242D9C370A10AA7F3259ADACACAB6359574949B608837314899A4E4A3708158913D655894E9A85D23C089C4C8B9F2514E7E8E9EAEBECEDEE"x
  1200.                            NewFileData = NewFileData || "E86DCCA3F3F4F32D09F8F9FAFBFCFDFEFFE46E8DC8C5AB8A8D1C47D4E8E861AC8CB03143902451B06CD09D2A4878847935A4A3AB57B0C60881A86542C5372E1E"x
  1201.                            NewFileData = NewFileData || "FFF1D85303C29F8E6460B15AC80AA2C40A3C4C069487CB85CB471868E090A1A087C399AB90F2C10068E7A03810A030C0040507A23DD69E48B0D2064391179338"x
  1202.                            NewFileData = NewFileData || "9DECF9C7E59F439824748BA0F589214895B8954DAB296C27A728FFE9DDCB371FDE7A80030B1E4CB8B0E1140B122B5ECCB8B1E3C79013FF1D48686D9C3B07ED20"x
  1203.                            NewFileData = NewFileData || "D313B163C65335FE8CA55C68429DCC7960CA129645C810216892CC182D024E2F3C3A4ADAD042A415C72122555F1817EFA9E91C6A567DFCB271E351E09D33D256"x
  1204.                            NewFileData = NewFileData || "30C54EC96147B67871D01C5630D55C741647A94A63C71ABBF71805794C58E788CA26D726E412A31D18322EB077E825D94C3525AD211F7595155217684BF4D0C0"x
  1205.                            NewFileData = NewFileData || "B030C668710519EAE1419C2028FD62960CE5CD908343EA2574051FBC5034602E172A610A1F39E4F4618AA744C0D40C628DE8425DD0D4F0958B3720B21538D820"x
  1206.                            NewFileData = NewFileData || "B003021684080103143C124E8CE3F5642006CF28720805D158C0D6053620F08C5A124009A302D664F9CC2F1396D3D34F4B58104E05456A7201946F4DC2402218"x
  1207.                            NewFileData = NewFileData || "44C24951694E52C874B92C218E81738A03E69E7E6A829F85610A545B038826AAE8A28C36EAE8A3882679D8A494565A4208003B5031444449520D0A5031444449"x
  1208.                            NewFileData = NewFileData || "520D0A5031444449520D0A5031444449520D0A5031444449520D0A5031444449520D0A"x
  1209.                #DefineRexx
  1210.                <$RebuildFile FILE="search.gif">
  1211.        #endif
  1212. #endif
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218. ;----------------------------------------------------------------------------
  1219. ;--- CONTENTS VARIABLES -----------------------------------------------------
  1220. ;----------------------------------------------------------------------------
  1221. #RexxVar  RxUniqueContentsNumb = 0           ;;Number each item 1,2,3 ...
  1222. #RexxVar  RxContentsLevel      = 0           ;;"Indenting" level
  1223. #RexxVar  RxContentsSimple     = ""          ;;Simple list based contents (fully expanded)
  1224. #RexxVar  RxContentsJava       = ""          ;;Java based contents
  1225.  
  1226.  
  1227. ;----------------------------------------------------------------------------
  1228. ;--- CONTENTS ---------------------------------------------------------------
  1229. ;----------------------------------------------------------------------------
  1230. #if    ['<$DocType>' = 'HTML']
  1231.        #define _AddToContents                                                                                 \
  1232.                ;--- Have another contents item -------------------------------                               -\
  1233.                #RexxVar  RxUniqueContentsNumb + '1'                                                          -\
  1234.                                                                                                              -\
  1235.                ;--- Simple - Need to change levels? -------------------------                                -\
  1236.                #if  [RxHeadingLevel <> RxContentsLevel]                                                      -\
  1237.                        ;--- Simple - Need to generate at least one "<UL>" or "</UL>" --                      -\
  1238.                        #if [RxHeadingLevel > RxContentsLevel]                                                -\
  1239.                            #evaluate ""  do RxHeadingLevel-RxContentsLevel; RxContentsSimple = RxContentsSimple || '<UL><?NewLine>'; end  -\
  1240.                        #elseif                                                                                                              -\
  1241.                            #evaluate ""  do RxContentsLevel-RxHeadingLevel; RxContentsSimple = RxContentsSimple || '</UL><?NewLine>'; end -\
  1242.                        #endif                                                                                -\
  1243.                        #RexxVar RxContentsLevel = RxHeadingLevel                                             -\
  1244.                #endif                                                                                        -\
  1245.                                                                                                              -\
  1246.                ;--- Simple - Add contents item ------------------------------                                -\
  1247.                #evaluate  ""  RxContentsSimple = RxContentsSimple || "<LI><" || '$LinkTo ID=■{$Id $$SQx2}■ TEXT=■{$Text $$SQx2}■><?NewLine>' -\
  1248.                                                                                                              -\
  1249.                ;--- Want Java based Navigation? -----------------------------                                -\
  1250.                #ifdef OL_DOC_TRY_JAVA_NAVIGATION                                                             -\
  1251.                    ;--- Java - Remember this item was at this level ---------                                -\
  1252.                    #RexxVar  RxLastContentsItem.<??RxHeadingLevel> = '{$Text}'                               -\
  1253.                                                                                                              -\
  1254.                    ;--- Java - Add contents item ----------------------------                                -\
  1255.                    #evaluate  ""  RxContentsJava = RxContentsJava || '<param name="item<??RxUniqueContentsNumb>" value ="' || RxLastContentsItem.1 -\
  1256.                    #evaluate  ""  do I=2 to RxHeadingLevel; RxContentsJava = RxContentsJava || '/' || RxLastContentsItem.I; end;                   -\
  1257.                    #evaluate  ""  RxContentsJava = RxContentsJava || ';' || ';<??RxValidId>.<$HtmlExtension>;{$Text}"><?NewLine>'                  -\
  1258.                #endif
  1259.  
  1260.  
  1261.        #define _GenerateContentsHtml                                                                                \
  1262.                ;--- Simple - Output Start of HTML ---------------------------                                      -\
  1263.                <$HeadingCodes TEXT='<$OL_DOC_HTML_CONTENTS_TITLE>'><?NewLine>                                      -\
  1264.                <CENTER><H1><$OL_DOC_HTML_CONTENTS_TITLE></H1></CENTER><?NewLine>                                   -\
  1265.                                                                                                                    -\
  1266.                ;--- Simple - Output contents (use d2c(10) to process macros -                                      -\
  1267.                #evaluate ""  do RxContentsLevel; RxContentsSimple = RxContentsSimple || '</UL><?NewLine>'; end   -\
  1268.                #evaluate ""  "RxContentsSimple = RxContentsSimple || d2c(10)"                                      -\
  1269.                <UL><??RxContentsSimple></UL>      ;;Extra indenting                                                -\
  1270.                                                                                                                    -\
  1271.                ;--- Want Java based Navigation? -----------------------------                                      -\
  1272.                #ifdef OL_DOC_TRY_JAVA_NAVIGATION                                                                   -\
  1273.                    ;--- Generate separate contents for testing for now ----------                                  -\
  1274.                    <P>Please try the <A HREF="treecont.htm">Java TREE</A> version of                                \
  1275.                    this contents and <A HREF="mailto:<?PpwizardAuthorEmail>?subject=PPWIZARD JAVA TREE CONTENTS">tell me</A> \
  1276.                    if it works and if it does what operating system, browser, java version ("java -version") etc             \
  1277.                    you are using and whether you liked the way it works.  THANKS.                                  -\
  1278.                    #output "treecont.htm"                                                                          -\
  1279.                    <$HeadingCodes TEXT='JAVA TREE TEST - <$OL_DOC_HTML_CONTENTS_TITLE>'><?NewLine>                 -\
  1280.                    <CENTER><H1>JAVA TREE TEST - <$OL_DOC_HTML_CONTENTS_TITLE></H1></CENTER><?NewLine>              -\
  1281.                    <?NewLine>                                                                                      -\
  1282.                    <applet width="100%" height="70%" name="Tree" code="TreeApp.class" align="top">                 -\
  1283.                    <?NewLine><??RxContentsJava>                                                                    -\
  1284.                    </applet>                                                                                       -\
  1285.                    <?NewLine>                                                                                      -\
  1286.                    #ifdef  OL_DOC_HTML_FOOTER                                                                      -\
  1287.                            <$OL_DOC_HTML_FOOTER CONTENTS='Y'>                                                      -\
  1288.                    #endif                                                                                          -\
  1289.                    <?NewLine>                                                                                      -\
  1290.                    </BODY></HTML>                                                                                  -\
  1291.                    #output                                                                                         -\
  1292.                #endif                                                                                              -\
  1293.                                                                                                                    -\
  1294.                ;--- Complete the HTML index page ----------------------------                                      -\
  1295.                #RexxVar HtmlPrevId1     = ''                                                                           -\
  1296.                #RexxVar HtmlPrevIdText1 = ''                                                                           -\
  1297.                #RexxVar HtmlPrevId2     = ''                                                                           -\
  1298.                #RexxVar HtmlPrevIdText2 = ''                                                                           -\
  1299.                #RexxVar HtmlNextId      = ''                                                                            -\
  1300.                #RexxVar HtmlNextIdText  = ''                                                                            -\
  1301.                #ifdef  OL_DOC_HTML_FOOTER                                                                          -\
  1302.                        <$OL_DOC_HTML_FOOTER CONTENTS='Y'>                                                          -\
  1303.                #endif                                                                                              -\
  1304.                <$_HeadingEndHtml>      ;;Finish off contents
  1305. #endif
  1306.  
  1307.  
  1308.