home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / htmepm98.zip / HTMLTAGS.E < prev    next >
Text File  |  1995-09-02  |  34KB  |  1,041 lines

  1. compile if not defined(SMALL)  -- If SMALL not defined, then being separately compiled
  2.  define INCLUDING_FILE = 'HTMLTAGS.E'
  3.  const
  4.  compile if not defined(SITE_CONFIG)
  5.     const SITE_CONFIG = 'SITECNF.E'
  6.  compile endif
  7.  compile if SITE_CONFIG
  8.    tryinclude SITE_CONFIG
  9.  compile endif
  10. compile endif
  11.  
  12.  
  13. const
  14. compile if not defined(WANT_DYNAMIC_PROMPTS)
  15.    WANT_DYNAMIC_PROMPTS = 1
  16. compile endif
  17.  
  18.  
  19. const
  20.    HTMLVERSION=                '0.98'
  21.    HTMLTAGS_BAR__MSG =         'H~TML '
  22.    TITLE_MENU_MSG =            '~Title               Ctrl+T'
  23.    CENTER_MENU_MSG =           '~Center              Ctrl+C'
  24.    COMMENTS_MENU_MSG =         'C~omment           Ctrl+O'
  25.    SEPARATORS_MENU_MSG =       'S~eparators'
  26.    PARAGRAPH_MENU__MSG =       '~Paragraph           Ctrl+P'
  27.    PARAGRAPHP_MENU__MSG =      'P~aragraph HTML+   Ctrl+-'
  28.    FORCEDLINE_MENU_MSG =       'Forced Line ~Break  Ctrl+B'
  29.    HORIZONTALRULE_MENU_MSG =   '~Horizontal rule      Ctrl+H'
  30.    ANCHOR_MENU_MSG =           'Lin~k to             Ctrl+K'
  31.    IMAGE_MENU_MSG =            '~Image Inline        Ctrl+I'
  32.    TARGET_MENU_MSG=            'Anchor Tar~get      Ctrl+G'
  33.    HEADINGS_MENU__MSG =        '~Headings'
  34.    HEAD1_MENU__MSG =           'Heading ~1   Ctrl+1'
  35.    HEAD2_MENU__MSG =           'Heading ~2   Ctrl+2'
  36.    HEAD3_MENU__MSG =           'Heading ~3   Ctrl+3'
  37.    HEAD4_MENU__MSG =           'Heading ~4   Ctrl+4'
  38.    HEAD5_MENU__MSG =           'Heading ~5   Ctrl+5'
  39.    HEAD6_MENU__MSG =           'Heading ~6   Ctrl+6'
  40.    STYLES_MENU_MSG =           '~Styles'
  41.    LOGICAL_MENU_MSG =          'Logical St~yles'
  42.    EM_MENU__MSG =              '~Emphasize'
  43.    STRONG_MENU_MSG =           '~Strong emphasize'
  44.    PREFORMAT_MENU_MSG =        '~Preformated Text'
  45.    ADDRESS_MENU_MSG =          '~Address'
  46.    PHYSICAL_MENU__MSG =        '~Physical styles'
  47.    UNDERLINE_MENU__MSG =       '~Underline'
  48.    ITALIC_MENU__MSG =          '~Italic'
  49.    BOLD_MENU__MSG =            '~Bold'
  50.    TYPEWRITER_MENU__MSG =      '~Typewriter'
  51.    LISTS_MENU_MSG =            '~Lists'
  52.    LIST_ITEM_MENU__MSG =       'List ~Item      Ctrl+L'
  53.    OLIST_MENU__MSG =           '~Ordered list'
  54.    ULIST_MENU__MSG =           '~Unordered list'
  55.    DIR_MENU__MSG =             '~Directory List'
  56.    SLIST_MENU__MSG =           '~Menu list'
  57.    DLIST_MENU__MSG =           'Definition ~List'
  58.    DLISTTERM_MENU_MSG =        'Definition List ~Term'
  59.    DLISTDEF_MENU_MSG =         'De~finition List Definition'
  60.    TABLA_MENU_MSG =            'Ta~ble'
  61.    SPECIAL_MENU_MSG =          'Speci~al Characters'
  62.    LEFTANGLE_MENU_MSG =        '~<'
  63.    RIGHTANGLE_MENU_MSG =       '~>'
  64.    A_ACUTE_MENU_MSG =          'á '
  65.    E_ACUTE_MENU_MSG =          'é '
  66.    I_ACUTE_MENU_MSG =          'í '
  67.    O_ACUTE_MENU_MSG =          'ó '
  68.    U_ACUTE_MENU_MSG =          'ú '
  69.    AMPERSAND_MENU_MSG =        'Am~persand'
  70.    QUOTES_MENU_MSG =           '~Quotes'
  71.    TILDE_MENU_MSG  =           '~Tilde'
  72.    ACCENT_MENU_MSG =           '~Acute accent'
  73.    FORMS_MENU_MSG =            '~Forms'
  74.    DEFFORMS_MENU_MSG =         '~Define Form'
  75.    INPUTFIELD_MENU_MSG =       '~Input field'
  76.    SELECTFIELD_MENU_MSG =      '~Select field'
  77.    SELECTOPTION_MENU_MSG =     'Select ~Option'
  78.    TEXTAREA_MENU_MSG =         '~Text area'
  79.    DOC_MENU__MSG =             'Docu~ments'
  80.    HTMLDOC_MENU__MSG =         '~Basic HTML doc'
  81.    PREVIEW_MENU__MSG =         'Pre~view'
  82.    ATTR_ON_MENU__MSG =         'Tags Hightlight On'
  83.    ATTR_OFF_MENU__MSG =        'Tags Hightlight Off'
  84.    ABOUT_MENU_MSG =            'Abo~ut...'
  85.  
  86. compile if WANT_DYNAMIC_PROMPTS
  87.    HTMLTAGS_BARP__MSG = \1'Create HTLM tags'
  88.    TITLE_MENUP_MSG = \1'Insert Title TAG '
  89.    CENTER_MENUP__MSG = \1'Center the text'
  90.    COMMENTS_MENUP_MSG = \1'Mark selected text as comment'
  91.    SEPARATORS_MENUP_MSG = \1'Paragraphs, Line Breaks & Rules'
  92.    PARAGRAPH_MENUP__MSG = \1'Insert a Paragraph tag'
  93.    PARAGRAPHP_MENUP__MSG = \1'Insert a Paragraph tag in HTML+'
  94.    FORCEDLINE_MENUP_MSG = \1'Insert a Forced Line Break'
  95.    HORIZONTALRULE_MENUP_MSG = \1'Insert an horizontal rule'
  96.    ANCHOR_MENUP_MSG = \1'Create a link'
  97.    IMAGE_MENUP_MSG = \1'Insert an image'
  98.    TARGET_MENUP_MSG = \1'Define a named anchor'
  99.    HEADINGS_MENUP__MSG = \1'Select size of a heading'
  100.    HEAD1_MENUP__MSG = \1'Select heading size 1'
  101.    HEAD2_MENUP__MSG = \1'Select heading size 2'
  102.    HEAD3_MENUP__MSG = \1'Select heading size 3'
  103.    HEAD4_MENUP__MSG = \1'Select heading size 4'
  104.    HEAD5_MENUP__MSG = \1'Select heading size 5'
  105.    HEAD6_MENUP__MSG = \1'Select heading size 6'
  106.    STYLES_MENUP_MSG = \1'Select the text style '
  107.    LOGICAL_MENUP_MSG = \1'Select between logical styles'
  108.    EM_MENUP__MSG = \1'Set emphasized style for selected text'
  109.    STRONG_MENUP_MSG = \1'Set strong emphasized style for selected text'
  110.    PREFORMAT_MENUP_MSG = \1'Let the selected text "as it is"'
  111.    ADDRESS_MENUP_MSG = \1'Render text as "address"'
  112.    PHYSICAL_MENUP__MSG = \1'Select physical style'
  113.    UNDERLINE_MENUP__MSG =\1'Set underline style for the selected text'
  114.    ITALIC_MENUP__MSG = \1'Set italic style for the selected text'
  115.    BOLD_MENUP__MSG = \1'Select bold style for the selected text'
  116.    TYPEWRITER_MENUP__MSG = \1'Select typewriter style for the selected text'
  117.    LISTS_MENUP_MSG = \1'Lists related tags'
  118.    LIST_ITEM_MENUP__MSG = \1'Create a list item'
  119.    OLIST_MENUP__MSG = \1'Create an ordered list'
  120.    ULIST_MENUP__MSG = \1'Create an unordered list'
  121.    DIR_MENUP__MSG =    \1'Create a directory list'
  122.    SLIST_MENUP__MSG = \1'Create a menu list'
  123.    DLIST_MENUP__MSG = \1'Create a definition list'
  124.    DLISTTERM_MENUP_MSG = \1'Insert a definition list term tag'
  125.    DLISTDEF_MENUP_MSG = \1'Insert a definition list definition tag'
  126.    SPECIAL_MENUP_MSG = \1'Insert Special Characters'
  127.    LEFTANGLE_MENUP_MSG = \1'Insert a left angle sign'
  128.    RIGHTANGLE_MENUP_MSG = \1'Insert a right angle sign'
  129.    AMPERSAND_MENUP_MSG = \1 'Insert the Ampersand sign'
  130.    QUOTES_MENUP_MSG = \1'Insert a double Quotes sign'
  131.    TILDE_MENUP_MSG  =    \1'Tilde'
  132.    ACCENT_MENUP_MSG = \1'Acute accent'
  133.    FORMS_MENUP_MSG = \1'HTML Forms Interface'
  134.    DEFFORMS_MENUP_MSG = \1'Define a Form'
  135.    INPUTFIELD_MENUP_MSG = \1'Define an Input field'
  136.    SELECTFIELD_MENUP_MSG = \1'Define a Select field'
  137.    SELECTOPTION_MENUP_MSG = \1'Define a Select field Option'
  138.    TEXTAREA_MENUP_MSG = \1'Define a Text Area'
  139.    DOC_MENUP__MSG = \1'Creating HTML Documents'
  140.    HTMLDOC_MENUP__MSG = \1'Create a Basic HTML Doc'
  141.    PREVIEW_MENUP__MSG = \1'View file with WebExplorer'
  142.    ATTR_ON_MENUP__MSG = \1'Set color hightlight of HTML tags'
  143.    ATTR_OFF_MENUP__MSG = \1'Unset color hightlight of HTML tags'
  144. compile else
  145.    HTMLTAGS_BARP__MSG = ''
  146.    TITLE_MENUP_MSG = ''
  147.    CENTER_MENUP__MSG=''
  148.    COMMENTS_MENUP_MSG= ''
  149.    SEPARATORS_MENUP_MSG = ''
  150.    PARAGRAPH_MENUP__MSG = ''
  151.    PARAGRAPHP_MENUP__MSG =''
  152.    FORCEDLINE_MENUP_MSG = ''
  153.    HORIZONTALRULE_MENUP_MSG = ''
  154.    ANCHOR_MENUP_MSG = ''
  155.    IMAGE_MENUP_MSG = ''
  156.    TARGET_MENUP_MSG= ''
  157.    HEADINGS_MENUP__MSG = ''
  158.    HEAD1_MENUP__MSG = ''
  159.    HEAD2_MENUP__MSG = ''
  160.    HEAD3_MENUP__MSG = ''
  161.    HEAD4_MENUP__MSG = ''
  162.    HEAD5_MENUP__MSG = ''
  163.    HEAD6_MENUP__MSG = ''
  164.    STYLES_MENUP_MSG = ''
  165.    LOGICAL_MENUP_MSG = ''
  166.    EM_MENUP__MSG = ''
  167.    STRONG_MENUP_MSG = ''
  168.    PREFORMAT_MENUP_MSG = ''
  169.    PHYSICAL_MENUP__MSG = ''
  170.    UNDERLINE_MENUP__MSG = ''
  171.    ITALIC_MENUP__MSG = ''
  172.    BOLD_MENUP__MSG = ''
  173.    TYPEWRITER_MENUP__MSG = ''
  174.    LISTS_MENUP_MSG = ''
  175.    LIST_ITEM_MENUP__MSG = ''
  176.    OLIST_MENUP__MSG = ''
  177.    ULIST_MENUP__MSG = ''
  178.    DIR_MENUP__MSG = ''
  179.    SLIST_MENUP__MSG = ''
  180.    DLIST_MENUP__MSG = ''
  181.    DLISTTERM_MENUP_MSG = ''
  182.    DLISTDEF_MENUP_MSG = ''
  183.    SPECIAL_MENUP_MSG = ''
  184.    LEFTANGLE_MENUP_MSG = ''
  185.    RIGHTANGLE_MENUP_MSG = ''
  186.    AMPERSAND_MENUP_MSG = ''
  187.    QUOTES_MENUP_MSG = ''
  188.    TILDE_MENUP_MSG  = ''
  189.    ACCENT_MENUP_MSG = ''
  190.    FORMS_MENUP_MSG = ''
  191.    DEFFORMS_MENUP_MSG =''
  192.    INPUTFIELD_MENUP_MSG = ''
  193.    SELECTFIELD_MENUP_MSG =  ''
  194.    SELECTOPTION_MENUP_MSG =  ''
  195.    TEXTAREA_MENUP_MSG =  ''
  196.    DOC_MENUP__MSG = ''
  197.    HTMLDOC_MENUP__MSG = ''
  198.   PREVIEW_MENUP__MSG = ''
  199.    ATTR_ON_MENUP__MSG = ''
  200.    ATTR_OFF_MENUP__MSG = ''
  201.  
  202. compile endif
  203.  
  204.  
  205. definit
  206.    universal defaultmenu, activemenu
  207.    universal activeaccel
  208.    universal HTML_tags_menu_flag
  209.    universal High_ON
  210.    deletemenu defaultmenu, 6, 0, 0  -- delete the existing Help menu (we want it to stay at the right)
  211.  
  212.    buildsubmenu defaultmenu, 80, HTMLTAGS_BAR__MSG, ' ', 0, 0
  213.      buildmenuitem defaultmenu, 80, 8000,TITLE_MENU_MSG,'HTML_EM TITLE'TITLE_MENUP_MSG,0,0
  214.      buildmenuitem defaultmenu, 80, 8001,CENTER_MENU_MSG,'HTML_EM CENTER'CENTER_MENUP__MSG,0,0
  215.      buildmenuitem defaultmenu, 80, 8002,COMMENTS_MENU_MSG,'HTML_COMMENTS'COMMENTS_MENUP_MSG,0,0
  216.      buildmenuitem defaultmenu, 80, 8003,\0,'',4,0
  217.      buildmenuitem defaultmenu, 80, 8004,SEPARATORS_MENU_MSG,SEPARATORS_MENUP_MSG,17,0
  218.      buildmenuitem defaultmenu, 80, 8005,PARAGRAPH_MENU__MSG,'HTML_P'PARAGRAPH_MENUP__MSG,0,0
  219.      buildmenuitem defaultmenu, 80, 8006,PARAGRAPHP_MENU__MSG,'HTML_EM P'PARAGRAPHP_MENUP__MSG,0,0
  220.      buildmenuitem defaultmenu, 80, 8007,FORCEDLINE_MENU_MSG,'HTML_INL <BR>'FORCEDLINE_MENUP_MSG,0,0
  221.      buildmenuitem defaultmenu, 80, 8008,HORIZONTALRULE_MENU_MSG,'HTML_INL <HR>'HORIZONTALRULE_MENUP_MSG,32769,0
  222.      buildmenuitem defaultmenu, 80, 8009,\0,'',4,0
  223.  
  224.      buildmenuitem defaultmenu, 80, 8010,ANCHOR_MENU_MSG,'HTML_ANCHOR'ANCHOR_MENUP_MSG,0,0
  225.      buildmenuitem defaultmenu, 80, 8011,IMAGE_MENU_MSG,'HTML_IMAGE'IMAGE_MENUP_MSG,0,0
  226.      buildmenuitem defaultmenu, 80, 8012,TARGET_MENU_MSG,'HTML_TARGET'TARGET_MENUP_MSG,0,0
  227.      buildmenuitem defaultmenu, 80, 8019,\0,'',4,0
  228.  
  229.      buildmenuitem defaultmenu, 80, 8020, HEADINGS_MENU__MSG, HEADINGS_MENUP__MSG, 17, 0
  230.      buildmenuitem defaultmenu, 80, 8021, HEAD1_MENU__MSG, 'HTML_EM H1'HEAD1_MENUP__MSG, 0, 0
  231.      buildmenuitem defaultmenu, 80, 8022, HEAD2_MENU__MSG, 'HTML_EM H2'HEAD2_MENUP__MSG, 0, 0
  232.      buildmenuitem defaultmenu, 80, 8023, HEAD3_MENU__MSG, 'HTML_EM H3'HEAD3_MENUP__MSG, 0, 0
  233.      buildmenuitem defaultmenu, 80, 8024, HEAD4_MENU__MSG, 'HTML_EM H4'HEAD4_MENUP__MSG, 0, 0
  234.      buildmenuitem defaultmenu, 80, 8025, HEAD5_MENU__MSG, 'HTML_EM H5'HEAD5_MENUP__MSG, 0, 0
  235.      buildmenuitem defaultmenu, 80, 8026, HEAD6_MENU__MSG, 'HTML_EM H6'HEAD6_MENUP__MSG, 32769, 0
  236.  
  237.      buildmenuitem defaultmenu, 80, 8030, LOGICAL_MENU_MSG, LOGICAL_MENUP_MSG,17,0
  238.      buildmenuitem defaultmenu, 80, 8031, EM_MENU__MSG,'HTML_EM EM'EM_MENUP__MSG, 0, 0
  239.      buildmenuitem defaultmenu, 80, 8032, STRONG_MENU_MSG, 'HTML_EM STRONG'STRONG_MENUP_MSG, 0, 0
  240.      buildmenuitem defaultmenu, 80, 8033, PREFORMAT_MENU_MSG,'HTML_EM PRE'PREFORMAT_MENUP_MSG, 0,0
  241.      buildmenuitem defaultmenu, 80, 8034, ADDRESS_MENU_MSG,'HTML_EM ADDRESS'ADDRESS_MENUP_MSG,32769,0
  242.      buildmenuitem defaultmenu, 80, 8035, PHYSICAL_MENU__MSG,PHYSICAL_MENUP__MSG, 17, 0
  243.      buildmenuitem defaultmenu, 80, 8036, UNDERLINE_MENU__MSG, 'HTML_EM U'UNDERLINE_MENUP__MSG, 0, 0
  244.      buildmenuitem defaultmenu, 80, 8037, ITALIC_MENU__MSG, 'HTML_EM I'ITALIC_MENUP__MSG, 0, 0
  245.      buildmenuitem defaultmenu, 80, 8038, BOLD_MENU__MSG, 'HTML_EM B'BOLD_MENUP__MSG, 0, 0
  246.      buildmenuitem defaultmenu, 80, 8039, TYPEWRITER_MENU__MSG, 'HTML_EM TT'TYPEWRITER_MENUP__MSG, 32769, 0
  247.  
  248.      buildmenuitem defaultmenu, 80, 8040, LISTS_MENU_MSG, LISTS_MENUP_MSG,17,0
  249.      buildmenuitem defaultmenu, 80, 8041, LIST_ITEM_MENU__MSG, 'HTML_I <LI>'LIST_ITEM_MENUP__MSG, 0, 0
  250.      buildmenuitem defaultmenu, 80, 8042, OLIST_MENU__MSG, 'HTML_LIST OL'OLIST_MENUP__MSG, 0, 0
  251.      buildmenuitem defaultmenu, 80, 8043, ULIST_MENU__MSG, 'HTML_LIST UL'ULIST_MENUP__MSG, 0, 0
  252.      buildmenuitem defaultmenu, 80, 8044, DIR_MENU__MSG,'HTML_LIST DIR'DIR_MENUP__MSG,0,0
  253.      buildmenuitem defaultmenu, 80, 8045, SLIST_MENU__MSG, 'HTML_LIST MENU'SLIST_MENUP__MSG, 0, 0
  254.      buildmenuitem defaultmenu, 80, 8046, DLIST_MENU__MSG, 'HTML_LIST DL'DLIST_MENUP__MSG, 0, 0
  255.      buildmenuitem defaultmenu, 80, 8047, DLISTTERM_MENU_MSG,'HTML_I  <DT>'DLISTTERM_MENUP_MSG,0,0
  256.      buildmenuitem defaultmenu, 80, 8048, DLISTDEF_MENU_MSG,'HTML_I   <DD>'DLISTDEF_MENUp_MSG,32769,0
  257.      buildmenuitem defaultmenu, 80, 8049, TABLA_MENU_MSG,'tabla',0,0
  258.      buildmenuitem defaultmenu, 80, 8050, \0,'',4, 0
  259.  
  260.      buildmenuitem defaultmenu, 80, 8051,SPECIAL_MENU_MSG,SPECIAL_MENUP_MSG,17,0
  261.      buildmenuitem defaultmenu, 80, 8052,LEFTANGLE_MENU_MSG,'HTML_I <'LEFTANGLE_MENUP_MSG,0,0
  262.      buildmenuitem defaultmenu, 80, 8053,RIGHTANGLE_MENU_MSG,'HTML_I >'RIGHTANGLE_MENUP_MSG,0,0
  263.      buildmenuitem defaultmenu, 80, 8054,AMPERSAND_MENU_MSG,'HTML_I &'AMPERSAND_MENUP_MSG,0,0
  264.      buildmenuitem defaultmenu, 80, 8055,QUOTES_MENU_MSG,'HTML_I "'QUOTES_MENUP_MSG,0,0
  265.      buildmenuitem defaultmenu, 80, 8056,TILDE_MENU_MSG,'HTML_ACC tilde;'TILDE_MENUP_MSG,0,0
  266.      buildmenuitem defaultmenu, 80, 8057,ACCENT_MENU_MSG,'HTML_ACC acute'ACCENT_MENUP_MSG,0,0
  267.      buildmenuitem defaultmenu, 80, 8058,A_ACUTE_MENU_MSG,'HTML_I á',0,0
  268.      buildmenuitem defaultmenu, 80, 8059,E_ACUTE_MENU_MSG,'HTML_I é',0,0
  269.      buildmenuitem defaultmenu, 80, 8060,I_ACUTE_MENU_MSG,'HTML_I í',0,0
  270.      buildmenuitem defaultmenu, 80, 8061,O_ACUTE_MENU_MSG,'HTML_I ó',0,0
  271.      buildmenuitem defaultmenu, 80, 8062,U_ACUTE_MENU_MSG,'HTML_I ú',32769,0
  272.      buildmenuitem defaultmenu, 80, 8069,\0,'',4,0
  273.  
  274.      buildmenuitem defaultmenu, 80, 8070, FORMS_MENU_MSG,FORMS_MENUP_MSG,17,0
  275.      buildmenuitem defaultmenu, 80, 8071, DEFFORMS_MENU_MSG,'HTML_FORM'DEFFORMS_MENUP_MSG,0,0
  276.      buildmenuitem defaultmenu, 80, 8072, INPUTFIELD_MENU_MSG,'HTML_INPUT'INPUTFIELD_MENUP_MSG,0,0
  277.      buildmenuitem defaultmenu, 80, 8073, SELECTFIELD_MENU_MSG,'HTML_SELECT'SELECTFIELD_MENUP_MSG,0,0
  278.      buildmenuitem defaultmenu, 80, 8074, SELECTOPTION_MENU_MSG, 'HTML_OPTION'SELECTOPTION_MENUP_MSG,0,0
  279.      buildmenuitem defaultmenu, 80, 8075, TEXTAREA_MENU_MSG, 'HTML_TEXTAREA'TEXTAREA_MENUP_MSG, 32769,0
  280.      buildmenuitem defaultmenu, 80, 8089, \0,'',4,0
  281.  
  282.      buildmenuitem defaultmenu, 80, 8090, DOC_MENU__MSG,DOC_MENUP__MSG, 17, 0
  283.      buildmenuitem defaultmenu, 80, 8091, HTMLDOC_MENU__MSG, 'HTML_HTMLDOC'HTMLDOC_MENUP__MSG, 32769, 0
  284.      buildmenuitem defaultmenu, 80, 8092, PREVIEW_MENU__MSG,'PREVIEW'PREVIEW_MENUP__MSG,0,0
  285.      buildmenuitem defaultmenu, 80, 8093, \0,'',4,0
  286.  
  287.      buildmenuitem defaultmenu, 80, 8101, ABOUT_MENU_MSG,'HTML_ABOUT',0,0
  288.      buildmenuitem defaultmenu, 80, 8109, \0,'',4,0
  289.  
  290.      buildmenuitem defaultmenu, 80, 8111, ATTR_ON_MENU__MSG,'ATTRON'ATTR_ON_MENUP__MSG,0,0
  291.      buildmenuitem defaultmenu, 80, 8119, ATTR_OFF_MENU__MSG,'ATTROFF'ATTR_OFF_MENUP__MSG,0,8192
  292.  
  293.      call readd_help_menu()
  294.      HTML_tags_menu_flag = 1
  295.      compile if EVERSION > '5.52'
  296.        call register_mousehandler(1,'2 CLICK 4','POPUP_MENU')
  297.      compile else
  298.        call register_mousehandler(1,'2 CLICK 0','POPUP_MENU')
  299.      compile endif
  300.      keys html_keys
  301.      call InitVars()
  302.  
  303.  
  304.  
  305. defexit
  306.    universal defaultmenu, activemenu
  307.    deletemenu defaultmenu,80,0,0
  308.    call maybe_show_menu()
  309.    HTML_tags_menu_flag = 0
  310.  
  311. defkeys html_keys overlay
  312.    def C_P = 'HTML_P'
  313.    def C_B = 'HTML_INL <BR>'
  314.    def C_H = 'HTML_INL <HR>'
  315.    def C_O = 'HTML_COMMENTS'
  316.    def C_C = 'HTML_EM CENTER'
  317.    def C_I = 'HTML_IMAGE'
  318.  
  319.    def C_1 = 'HTML_EM H1'
  320.    def C_2 = 'HTML_EM H2'
  321.    def C_3 = 'HTML_EM H3'
  322.    def C_4 = 'HTML_EM H4'
  323.    def C_5 = 'HTML_EM H5'
  324.    def C_6 = 'HTML_EM H6'
  325.    def C_K = 'HTML_ANCHOR'
  326.    def C_T = 'HTML_EM TITLE'
  327.    def C_G = 'HTML_TARGET'
  328.    def C_MINUS = 'HTML_EM P'
  329.    def C_L = 'HTML_I <LI>'
  330.  
  331. compile if EVERSION = '5.51a'
  332.    def 'á' = 'HTML_I á'
  333.    def 'é' = 'HTML_I é'
  334.    def 'í' = 'HTML_I í'
  335.    def 'ó' = 'HTML_I ó'
  336.    def 'ú' = 'HTML_I ú'
  337. compile endif
  338.  
  339. defload
  340.   universal High_ON
  341.   if pos(".htm",.filename) or pos(".html",.filename)then
  342.      keys html_keys
  343.      if High_ON then
  344.         call HILITE(1,.last)
  345.      endif
  346.   endif
  347.  
  348.  
  349. defproc InitVars()
  350.    universal High_ON, High_Color
  351.    High_ON = 0
  352.    High_Color = .textcolor
  353.  
  354.  
  355. defc HTML_P
  356.    universal High_ON
  357.    if .col = 1 then
  358.       keyin '<P>'
  359.   else
  360.       keyin '<P>'
  361.       insert
  362.       .col=1
  363.    endif
  364.  
  365. defc HTML_I
  366.    universal High_ON
  367.    l1 = .line
  368.    keyin arg(1)
  369.    l2 = .line
  370.    if High_ON then call HILITE(l1,l2) endif
  371.  
  372.  
  373. defc HTML_INL
  374.    universal High_ON
  375.    l1 = .line
  376.    keyin arg(1)
  377.    insert
  378.    .col = 0
  379.    l2 = .line
  380.    if High_ON then call HILITE(l1,l2) endif
  381.  
  382.  
  383. defc HTML_IML
  384.    universal High_ON
  385.    l1 = .line
  386.    parse value strip(arg(1),'L') with delim 2 rest
  387.    nextline = .line+1
  388.    do while rest <> ''
  389.       parse value rest with line (delim) rest
  390.       insertline line, nextline
  391.       nextline = nextline + 1
  392.    enddo
  393.    l2=.line
  394.    '+2'
  395.    end_line
  396.    .line = .line-1
  397.    l2 = .line
  398.    if High_ON then call HILITE(l1,l2) endif
  399.  
  400.  
  401. defc HTML_LIST
  402.     tag=arg(1)
  403.     if tag=='DL' then
  404.        param ='|<'tag'>|<DT>|</'tag'>|'
  405.     else
  406.        param ='|<'tag'>|<LI>|</'tag'>|'
  407.     endif
  408.     'HTML_IML 'param
  409.     '+1'
  410.  
  411.  
  412. defc HTML_COMMENTS
  413.    universal High_ON
  414.    l1 = .line
  415.    if marktype() then
  416.       call HTML_insert_tags('<!-- ',' -->')
  417.       call pend_mark()
  418.       unmark
  419.      .col=.col+4
  420.    else
  421.       keyin('<!-- -->')
  422.       .col=.col -  3
  423.       l2=.line
  424.       if High_ON then call HILITE(l1,l2) endif
  425.    endif
  426.  
  427.  
  428. defc HTML_EM
  429.    universal High_ON
  430.    l1 = .line
  431.    tag = arg(1)
  432.    if marktype() then
  433.       getmark firstline,lastline,firstcol,lastcol,fileid
  434.       call HTML_insert_tags('<'tag'>','</'tag'>')
  435.       call pend_mark()
  436.       unmark
  437.       .col = .col + length(tag) + 3
  438.    else
  439.       keyin('<'tag'></'tag'>')
  440.       .col = .col - length(tag)-3
  441.       l2 = .line
  442.       if High_ON then call HILITE(l1,l2) endif
  443.    endif
  444.  
  445.  
  446. defproc HTML_insert_tags(start_tag, end_tag)
  447.    universal High_ON
  448.    l1 = .line
  449.    mt = marktype()
  450.    if pos(leftstr(mt,1), 'BC') then  -- Block or Character mark
  451.       getfileid fid
  452.       getmark firstline,lastline,firstcol,lastcol,fileid
  453.       if fid<>fileid then
  454.          sayerror 'Wrong file - check mark'
  455.          return
  456.       endif
  457.    else
  458.       firstline = .line; lastline = .line;
  459.       call pend_word(); lastcol = .col
  460.       call pbegin_word(); firstcol = .col
  461.    endif
  462.    .col=lastcol+1
  463.    lastline
  464.    i_s = insert_state()
  465.    if not i_s then insert_toggle; endif
  466.    keyin end_tag
  467.    firstline
  468.    .col=firstcol
  469.    keyin start_tag
  470.    if pos(leftstr(mt,1), 'BC') then  -- Block or Character mark
  471.       l = length(start_tag)+1
  472.       call pset_mark(firstline, lastline, firstcol+l, lastcol+(l*(lastline=firstline)), mt, fileid)
  473.    endif
  474.    if not i_s then insert_toggle; endif
  475.    l2=.line
  476.    if High_ON then call HILITE(l1,l2) endif
  477.  
  478.  
  479. defc HTML_HTMLDOC
  480.    universal High_ON
  481.    'HTML_IML |<HTML>|<HEAD>|<TITLE></TITLE>|</HEAD>| |<BODY> | |</BODY>|</HTML>'
  482.    '+2'
  483.    .col = 8
  484.     if High_ON then call HILITE(1,.last) endif
  485.  
  486.  
  487. defc HTML_ANCHOR
  488.    universal High_ON
  489.    l1=.line
  490.    linktype = listbox("Select Link to ...",
  491.     "/anchor in this page/local file/anchor in local file/http/mailto/gopher/ftp/news/WAIS/Telnet","/Enter/Cancel" ,8,36,10)
  492.    if linktype == '' then
  493.       return
  494.    endif
  495.    if linktype == 'anchor in local file' then
  496.       filename = entrybox('Enter Filename')
  497.       if  filename == '' then return; endif
  498.       targetname = entrybox('Enter Target name')
  499.       if  targetname == '' then return; endif
  500.       linktype = filename'#'targetname
  501.       usertxt = ""
  502.    else if linktype == 'local file'  then
  503.       linktype = ''
  504.       usertxt = entrybox('Enter Name of Link')
  505.    else if linktype == 'anchor in this page' then
  506.       linktype = "#"
  507.       usertxt = entrybox('Enter target name')
  508.    else if linktype == 'mailto' then
  509.           linktype = 'mailto:'
  510.           usertxt=entrybox("Address to mailto: ")
  511.         else
  512.           linktype = linktype'://'
  513.           usertxt = entrybox("Enter full URL",,linktype)
  514.           linktype =''
  515.         endif
  516.     endif endif
  517.       if usertxt == '' then
  518.          return
  519.       endif
  520.    endif
  521.  
  522.    start_tag = '<A HREF="'||linktype||usertxt||'">'
  523.    end_tag = '</A>'
  524.    if marktype() then
  525.       call HTML_insert_tags(start_tag,end_tag)
  526.       call pend_mark()
  527.       unmark
  528.       .col=.col+length(end_tag)
  529.    else
  530.       keyin start_tag
  531.       keyin end_tag
  532.       l2 = .line
  533.       .col = .col - length(end_tag)
  534.       if High_ON then call HILITE(l1,l2)  endif
  535.    endif
  536.  
  537. defc HTML_TARGET
  538.    universal High_ON
  539.    usertxt = entrybox('Enter Anchor name')
  540.    if usertxt == "" then
  541.       return
  542.    endif
  543.    start_tag = '<A NAME="'usertxt'">'
  544.    end_tag = '</A>'
  545.    if marktype() then
  546.       call HTML_insert_tags(start_tag,end_tag)
  547.       call pend_mark()
  548.       unmark
  549.       .col=.col+length(end_tag)
  550.    else
  551.       l1 = .line
  552.       keyin start_tag
  553.       keyin end_tag
  554.       l2 = .line
  555.       if High_ON then call HILITE(l1,l2) endif
  556.       .col = .col-4
  557.    endif
  558.  
  559. defc HTML_IMAGE
  560.    universal High_ON
  561.    usertxt = entrybox('Enter Image Name')
  562.    if usertxt == '' then
  563.       return
  564.    endif
  565.    punto=lastpos('.',usertxt)
  566.    if punto then
  567.       alttext=substr(usertxt,1,punto-1)
  568.    else
  569.       alttext=usertxt
  570.    endif
  571.  
  572.    alttext = entrybox("Alternative text for non graphics display",,alttext)
  573.  
  574.    imag_pos = listbox("Image Alignment","/BOTTOM/MIDDLE/TOP/",,6,50)
  575.    if imag_pos == '' then
  576.       return
  577.    endif
  578.    IsMap = listbox("Image Map ?","/No/Yes/",,6,50)
  579.    if IsMap=="Yes" then
  580.       Ismap="ISMAP"
  581.    else
  582.       IsMap=""
  583.    endif
  584.    l1=.line
  585.    keyin '<IMG SRC="'usertxt'" ALIGN="'imag_pos'" ALT="'alttext'"' IsMap'>'
  586.    l2=.line
  587.    if High_ON then call HILITE(l1,l2) endif
  588.  
  589.  
  590.  
  591. defc HTML_ACC
  592.    mcol = .col
  593.    letter = get_char()
  594.    if pos(letter,'AEIOUaeiou') then
  595.       keyin '&'
  596.       .col = .col + 1
  597.       keyin arg(1)';'
  598.    else  if pos(letter,'Nn') then
  599.       keyin '&'
  600.       .col=.col+1
  601.       keyin arg(1)
  602.    else
  603.       sayerror("Invalid Character for accent in HTML")
  604.       return
  605.    endif   endif
  606.  
  607. defproc get_char
  608.    universal linepos,colpos,target
  609.    colpos = .col
  610.    linepos = .line
  611.    getline target
  612.    return substr(target,.col,1)
  613.  
  614. defc HTML_FORM
  615.    universal High_ON
  616.    action = entrybox('URL of program that will process the form')
  617.    method = listbox("Request Method",
  618.                       "/POST/GET/HEAD/PUT/DELETE/LINK/UNLINK/",,6,40,7)
  619.    if method=='' then
  620.      return
  621.    endif
  622.    start_tag = '<FORM ACTION="'||action||'" METHOD="'method'">'
  623.    end_tag = '</FORM>'
  624.  
  625.    if marktype() then
  626.       l1=.line
  627.       call HTML_insert_tags(start_tag,end_tag)
  628.       l2=.line
  629.       call pend_mark()
  630.       unmark
  631.       if High_ON then call HILITE(l1,l2) endif
  632.       .col=.col+length(end_tag)
  633.    else
  634.       l1 = .line
  635.       keyin start_tag
  636.       keyin end_tag
  637.       l2 = .line
  638.       if High_ON then call HILITE(l1,l2) endif
  639.       .col = .col-length(end_tag)
  640.    endif
  641.  
  642.  
  643.  
  644. defc HTML_INPUT
  645.    universal High_ON
  646.    l1 = .line
  647.    type = listbox("Enter of Input Field",
  648.                    "/text/password/checkbox/radio/submit/reset",,6,40, 6)
  649.    if type == "" then
  650.       return
  651.    endif
  652.    if type == 'radio' then
  653.       'HTML_radio'
  654.    else  if type == 'checkbox' then
  655.       'HTML_checkbox'
  656.    else  if type == 'submit' or type == 'reset' then
  657.       valor = entrybox("Text of the Button")
  658.       tag ='<INPUT TYPE="'type'" VALUE="'valor'">'
  659.    else
  660.       name = entrybox('Name of Variable ?')
  661.       if  name == '' then return; endif
  662.       valor = entrybox("Default Value")
  663.       size = entrybox("Maximum number of characters")
  664.       tag='<INPUT TYPE="'type'" NAME="'name'" '
  665.       if valor<>"" then
  666.           tag=tag' VALUE="'valor'" '
  667.       endif
  668.       tag=tag' SIZE='size' MAXLENGTH='size'>'
  669.    endif
  670.    keyin tag
  671.    l2 = .line
  672.    if High_ON then call HILITE(l1,l2) endif
  673.  
  674.    endif  endif
  675.  
  676. defc HTML_checkbox
  677.    universal High_ON
  678.    l1 = .line
  679.    name = entrybox("Name of the input variable?")
  680.    if  name == '' then return; endif
  681.    valor = entrybox("Value to return when checked")
  682.    if  valor == "" then return; endif
  683.    chktxt = entrybox("Text of the button")
  684.    tag = '<INPUT TYPE="CHECKBOX" NAME="'name'" VALUE="'valor'" '
  685.    defchk = listbox("Checked by default ?","/Yes/No/",,6,20)
  686.    if defchk == "Yes" then
  687.       tag = tag' CHECKED>'
  688.    else
  689.       tag = tag'>'
  690.    endif
  691.    keyin tag || chktxt' '
  692.    l2 = .line
  693.    if High_ON then call HILITE(l1,l2) endif
  694.    .col = .col + 1
  695.  
  696.  
  697. defc HTML_radio
  698.    universal option_Array, cadena
  699.    universal High_ON
  700.    l1 = .line
  701.    options = ''
  702.    rad_name = entrybox('Name of Radio Variable?')
  703.    if  rad_name == '' then return; endif
  704.    rad_num = listbox('Number of Radio Buttons',"/1/2/3/4/5/More",,6,20,6)
  705.    if rad_num == 'More' then
  706.       rad_num = entrybox('Enter number of Radio Buttons')
  707.    endif
  708.    if not isnum(rad_num) then
  709.       WinMessageBox('HTMLEPM 'HTMLVERSION, 'ERROR: Must enter a number',16384)
  710.       return
  711.    endif
  712.  
  713.    dispo = listbox("Button disposition","/Column/Row/",,6,20)
  714.    if dispo = "Row" then
  715.       separator = " "
  716.    else
  717.       separator = "<BR>"
  718.    endif
  719.  
  720.    do_array 1, opt_id, option_array
  721.    for i =1  to rad_num
  722.       opt = entrybox('Text of Button 'i)
  723.       rad_value = entrybox('Value returned when checked')
  724.       option_str = '<INPUT TYPE=RADIO NAME="'rad_name'" VALUE="'rad_value'">'opt||separator
  725.       do_array 2, opt_id, i, option_Str
  726.    endfor
  727.  
  728.    for i = 1 to rad_num
  729.       do_array 3, opt_id, i, cadena
  730.       insertline cadena
  731.    endfor
  732.    l2 =.line
  733.    if High_ON then call HILITE(l1,l2) endif
  734.  
  735.  
  736. defc HTML_SELECT
  737.    universal High_ON
  738.    l1 = .line
  739.    multiselect = 0
  740.    NotMoreChecks = 0
  741.    name = entrybox('Name of select variable')
  742.    if name == "" then
  743.       return
  744.    endif
  745.    sel_num = entrybox("Options number?")
  746.    if not isnum(sel_num) then
  747.       WinMessageBox('HTMLEPM 'HTMLVERSION, 'ERROR: Must be a number',16384)
  748.       return
  749.    endif
  750.    size = entrybox('Number of visible options ?')
  751.    if size == "" then
  752.       return
  753.    endif
  754.    if not isnum(size) then
  755.       WinMessageBox('HTMLEPM 'HTMLVERSION,'ERROR: Must be a number',16384)
  756.       return
  757.    endif
  758.  
  759.    multi = listbox('Multiple selection allowed?',"/No/Yes/",,6,40,2,30)
  760.    if multi == '' then
  761.       return
  762.    else
  763.       if multi == "Yes" then
  764.          multiselect = 1
  765.       else
  766.          multi = ""
  767.       endif
  768.    endif
  769.    tag_ini = '<SELECT NAME="'name'" SIZE='size || multi'>'
  770.    tag_end = '</SELECT>'
  771.  
  772.    insertline tag_ini
  773.    for i = 1 to sel_num
  774.       valor = entrybox('Text of Option 'i)
  775.       if  NotMoreChecks then
  776.          select = ""
  777.       else
  778.          select = listbox('Selected by default?',"/No/Yes/",,6,45)
  779.       endif
  780.       tag_1 = '<OPTION'
  781.       if select == 'Yes' then
  782.          tag_1 = tag_1 || ' SELECTED'
  783.          if not multiselect then
  784.             NotMoreChecks = 1
  785.          endif
  786.       endif
  787.       tag_1 = tag_1 '>'valor
  788.       insertline tag_1
  789.    endfor
  790.    insertline tag_end
  791.    l2 = .line
  792.    if High_ON then call HILITE(l1,l2) endif
  793.  
  794.  
  795. defc HTML_OPTION
  796.    universal High_ON
  797.    l1=.line
  798.    valor = entrybox('Option text')
  799.    select = listbox('Selected by default?',"/No/Yes/",,6,20)
  800.    tag_1 = '<OPTION'
  801.    if select == 'Yes' then
  802.       tag_1 = tag_1 || ' SELECTED'
  803.    endif
  804.    tag_1 = tag_1 '>'valor
  805.    keyin tag_1
  806.    l2 = .line
  807.    if High_ON then call HILITE(l1,l2) endif
  808.  
  809.  
  810. defc HTML_TEXTAREA
  811.    universal High_ON
  812.    lin_1 = .line
  813.    name = entrybox("Name of variable")
  814.    rows = entrybox("Number of rows")
  815.    cols  = entrybox("Number of columns")
  816.    default = listbox("Default Text ?","/No/Yes/",,6,50)
  817.    if default == "Yes" then
  818.       defText = entrybox("Enter the Default Text")
  819.    else
  820.       defText = ""
  821.    endif
  822.    keyin '<TEXTAREA NAME='name' ROWS='rows' COLS='cols'>'defText'</TEXTAREA>'
  823.    lin_2 = .line
  824.    if (High_ON) then call HILITE(lin_1, lin_2) endif
  825.  
  826. defc POPUP_MENU
  827.    elige = listbox("Select Tag Type",
  828.            "/Link/Image/Target/Define Form/Input Field/Select/Option/Text Area/Table/",
  829.            "/OK/Cancel",6,40,11,30)
  830.    if elige = "" then return
  831.    else if elige = 'Link'            then 'HTML_ANCHOR'
  832.    else if elige = 'Image'           then 'HTML_IMAGE'
  833.    else if elige = 'Target'          then 'HTML_TARGET'
  834.    else if elige = 'Define Form'     then 'HTML_FORM'
  835.    else if elige = 'Input Field'     then 'HTML_INPUT'
  836.    else if elige = 'Select'          then 'HTML_SELECT'
  837.    else if elige = 'Option'          then 'HTML_OPTION'
  838.    else if elige = 'Text Area'       then 'HTML_TEXTAREA'
  839.    else if elige = 'Table'            then 'TABLA'
  840.    endif endif endif endif endif endif endif endif endif endif
  841.  
  842.  
  843. defc HTML_ABOUT
  844.    linea=.line
  845.    WinMessageBox('HTML Extensions for EPM',
  846.             '     Version 'HTMLVERSION ||chr(10) ||
  847.             '     (c) E.Areitio 1995', 16384)
  848.    .line=linea
  849.  
  850.  
  851.  
  852. defc PREVIEW
  853.     CurrFile = .filename
  854.     place = lastpos('\', CurrFile)-1
  855.     CurrDir = leftstr(CurrFile, place)
  856.     'cd 'CurrDir
  857.     'start explore ' CurrFile
  858.  
  859. defc ATTROFF
  860.    universal High_ON
  861.    TOffset = -300
  862.    Column = 1
  863.    Line   = 0
  864.    Class  = 0
  865.    attribute_action 1,Class,TOffset,Column,Line
  866.    while  Class do
  867.       attribute_action 16,Class,TOffset,Column,Line
  868.       Class  = 0
  869.       attribute_action 1,Class,TOffset,Column,Line
  870.    endwhile
  871.    refresh
  872.    High_ON = 0
  873.    'ajusta_menu'
  874.  
  875.  
  876. defc ATTRON
  877.    universal High_ON, High_Color
  878.    High_ON = 1
  879.    Papel_Color = .textcolor // 16
  880.    Tinta_Color  = .textcolor %  16
  881.    High_Color = Papel_Color * 16 + Tinta_Color
  882.    call HILITE(1,.last)
  883.    'ajusta_menu'
  884.  
  885. defproc HILITE(pri,ult)
  886.    universal n,c
  887.    universal High_Color
  888.    entrycol=.col
  889.    entryline=.line
  890.    sayerror "Hightlighting ..."
  891.    class = 1
  892.    aclin = pri
  893.    ultimo = ult
  894.    abre = '<'
  895.    cierra = '>'
  896.    actual = abre
  897.    while  (aclin <= ultimo)  do
  898.       c = 1
  899.       linea=textline(aclin)
  900.       n = length(linea)
  901.       if (n) then
  902.          x=1
  903.          while (x & c <= n)  do
  904.             x = pos(actual,linea,c)
  905.             if x then
  906.                c = x+1
  907.                if actual == abre then
  908.                   insert_attribute class,High_Color,1,-1,x,aclin
  909.                   actual = cierra
  910.                else
  911.                   insert_attribute class,High_Color,0,-1,x+1,aclin
  912.                   actual = abre
  913.                endif
  914.             endif
  915.          endwhile
  916.       endif
  917.       aclin=aclin+1
  918.    endwhile
  919.    refresh
  920.    sayerror "Done."
  921.    .line=entryline
  922.    .col=entrycol
  923.  
  924. defc ajusta_menu
  925.    universal defaultmenu,High_ON
  926.    deletemenu defaultmenu,80,8111,1
  927.    deletemenu defaultmenu,80,8119,1
  928.    if (High_ON==1) then
  929.       buildmenuitem defaultmenu,80,8111,'Tag~s Hightlight On','ATTRON',0,8192
  930.       buildmenuitem defaultmenu,80,8119,'Tags Hightlight ~Off','ATTROFF',32769,0
  931.    else
  932.       buildmenuitem defaultmenu,80,8111,'Tag~s Hightlight On','ATTRON',0,0
  933.       buildmenuitem defaultmenu,80,8119,'Tags Hightlight~Off','ATTROFF',32769,8192
  934.    endif
  935.    showmenu defaultmenu
  936.  
  937. defc tabla
  938.   if marktype() =='' then
  939.      tabla_info="Table Option:"||chr(10)||
  940.                  "requires marked data in the form:"||chr(10)||chr(10)||
  941.                  "Table caption"||chr(10)||
  942.                  "         ColName1 ColName2 ColName3"||chr(10)||
  943.                  "RowName1 data data data"||chr(10)||
  944.                  "RowName2 data data data"||chr(10)||
  945.                  " ...."
  946.      WinMessageBox('HTML Extensions for EPM 0.98',tabla_info,16384)
  947.      return
  948.   endif
  949.   call pend_mark()
  950.   my_end_line = .line
  951.   call pbegin_mark()
  952.   my_init_line = .line
  953.   nrows=my_end_line-my_init_line-1
  954.   getline caption,my_init_line
  955.   getline col_names_line,my_init_line+1
  956.   ncols = words(col_names_line)
  957.   maxsize=0
  958.   for aclin=my_init_line+1 to my_end_line
  959.      getline linea,aclin
  960.      line_size = max_word_size(linea)
  961.      if maxsize <line_size  then
  962.         maxsize=line_size
  963.      endif
  964.   endfor
  965.  
  966.   sep_linea = '+'
  967.   tmp_linea = insertstr('-',sep_linea,1,maxsize+2,'-')
  968.   for i = 1 to ncols+1
  969.      sep_linea=insertstr(tmp_linea,sep_linea)
  970.   endfor
  971.  
  972.   oflin=1
  973.   insertline '<PRE>',my_end_line+oflin
  974.   oflin=oflin+1
  975.   captionline= '<B>'caption'</B>'
  976.   insertline captionline,my_end_line+oflin
  977.   oflin=oflin+1
  978.   insertline sep_linea,my_end_line+oflin
  979.   oflin=oflin+1
  980.   t_linea='|'
  981.   t_linea=insertstr(" ",t_linea,1,maxsize+2," ")'|'
  982.   for j = 1  to words(col_names_line)
  983.      ltpad=maxsize-length(word(col_names_line,j))
  984.      llpad=ltpad % 2
  985.      lrpad=ltpad-llpad
  986.      lpad=insertstr(" ","",1,llpad," ")
  987.      rpad=insertstr(" ","",1,lrpad," ")
  988.      t_linea=t_linea||lpad||word(col_names_line,j)||rpad'|'
  989.   endfor
  990.   insertline t_linea,my_end_line+oflin
  991.   oflin=oflin+1
  992.   insertline sep_linea,my_end_line+oflin
  993.   oflin=oflin+1
  994.   for linea = my_init_line + 2 to my_end_line
  995.      getline linea_actual,linea
  996.      t_linea='|'
  997.      for j = 1  to words(linea_actual)
  998.         if word(linea_actual,j)="*" then
  999.           t_linea=t_linea||insertstr("","",1,maxsize+1," ")'|'
  1000.         else
  1001.           ltpad=maxsize-length(word(linea_actual,j))
  1002.           llpad=ltpad % 2
  1003.           lrpad=ltpad-llpad
  1004.           lpad=insertstr(" ","",1,llpad," ")
  1005.           rpad=insertstr(" ","",1,lrpad," ")
  1006.           t_linea=t_linea||lpad||word(linea_actual,j)||rpad'|'
  1007.         endif
  1008.      endfor
  1009.  
  1010.      insertline t_linea,my_end_line+oflin
  1011.      insertline sep_linea,my_end_line+oflin+1
  1012.      oflin=oflin+2
  1013.   endfor
  1014.   insertline '</PRE>',my_end_line+oflin
  1015.  
  1016.   call pbegin_mark()
  1017.   aclin=.line-1
  1018.   for i = 1  to nrows +2
  1019.       getline linea,aclin+i
  1020.       newlinea='<!-- 'linea' -->'
  1021.       replaceline newlinea,aclin+i
  1022.   endfor
  1023.    insertline"",aclin+i
  1024.    insert
  1025.   unmark
  1026.   .line=.line+nrows*3+9
  1027.   .col=1
  1028.  
  1029.  
  1030.  
  1031. defproc max_word_size(linea)
  1032.   m=0
  1033.   for i=1 to words(linea)
  1034.     l=wordlength(linea,1)
  1035.      if l>m then
  1036.         m=l
  1037.      endif
  1038.   endfor
  1039.   return m
  1040.  
  1041.