// // XLIST-MC2.VDM Ch. Ziemski 28.04.2002 (as XLIST-MC.VDM) // 28.05.2004 complete new format implementation! // 14.09.2004 // 27.02.2005 // 07.11.2005 // 04.01.2009 new directory structure and creation of copy-to-website.cmd // // // This new version is in BETA phase now! // // Requires Vedit 6.12 or up // //------------------------------------------- // // -- Inline documentation -- (can be displayed with Shft-F1) // // *** XLIST-MC2.VDM - Xtended List Maintaining and Converting (to HTML) *** // ---------------------------------------------------------------------------- // // Shft-F1 : show this help // // F11 : Restart macro (checking files and generating the HTML pages) // // F12 : Open the file specified by the cursor line in another VEDIT buffer // (and close it again from there) // Ctrl-F12 : Open file in browser (works best with html-files ;-) // // Alt-F12 : Delete file specified by the cursor line (with confirmation dialog) // // ------------------------------------------------------------------------------ // // ... to do: more contents ... // // // Format of the definition file: // // * comments etc. // *{...} Tag for SUB categories, table names etc. // *>... inactive entry (file doesn't exist on disk (any more)) // |W_ line continuation (otherwise a line break is inserted in HTML) // // An example definiton file (that is used as template when creating a new one) // is appended to this macro, below the "__DATA__" marker. // // ---------------------------------------------------------------------------- // // I developed this macro to maintain a part of my website, where I'm // listing many VEDIT macros (my own and other's). // This macro creates the HTML-files which are uploaded to the webserver. // // // // // Since it's a work in progress (not only) this documentation is to be improved.... // //---------------------------------------------------------------------------------------- // // ToDo: // improve: // editing index.html not so hardcoded! // check filenames with spaces (F12 etc.) // filenames with more than one extension (or so) // more foolprof, esp. in finding block-names // create HTML-Tags from txt-file, e.g. for umlauts, <, > ... // better error dialogs (title line with macro name or so) // more docu and code optimizing // // add: // conversion to lower case filenames and links! (evtl. as option) // sync with another DIR/FTP // BAT-file for copying the bunch of html files to somewhere // exclude-list (from display and(?) from transfer) // index.cfg or so with target directory for html-files etc. // 2nd window with picklist of blocks/subs // last modified date per category -> color? // make-like generation? // {Tools} menu? // event macro for mouse? // // //---------------------------------------------------------------------------------------- // // The macro uses the following numerical and text registers. // They are NOT restored since there is no real "exiting" this macro! // // #85 buf num for temp. work // #86 counter for SUBs // #87 counter for files in SUB // #88 Cur_Line (for F12) // #89 Cur_Col (for F12) // #90 size of $100 (this macro itself), for restarting with F12 // #91 buffer num for DIR // #92 buffer num for definition file // #93 buffer num for html file // #94 buffer num for BlockList // #95 buffer num for alphabethic list // #96 buffer num for list by date // #97 BufNum of last loaded file +1000 (for F11) // #98 flag for loaded html file // #99 buffer num of definition file as flag whether it was open at startup // // #103 temp // #104 temp // #105 temp // #106 temp // //-------------- // // @71 complete description of one entry // @72 name of sub-table // @73 name of sub-table; for detecting switch of // @74 generated table(s) of file-links // @75 entry(/ies) of current HTML-file in definition file // @76 name of SUB // @77 all file entries of current SUB // @78 title of SUB (if any) // @79 "path" of current SUB // @80 list of macro filenames for copying to website // @81 current block ? // @82 current blockname ? // @83 filename of entry // @84 File_Stamp_String() // @85 marker for inactive entries // @86 name of definition file // @87 path of website-files (offline) // @88 directory for macros relative to the html files on website (not locally here inVEDIT home!) // @89 relative target directory for the generated HTML files (locally here in VEDIT home). Files later need to be copied to website's vedit root! // @90 html TITLE // @91 HTML template: html-header // @92 HTML template: table-header // @93 HTML template: table-row // @94 HTML template: table-end // @95 HTML template: html-footer // @96 HTML template: "Category" // @97 HTML template: "Sub-category" // @98 HTML template: "Last change" // // // @103 temp // @104 temp // @105 temp // @106 temp // @107 temp // //======================================================================================== // Buf_Switch(Buf_Free) Out_Ins() Version Out_Ins(CLEAR) BoF // VEDIT (32-Bit) Ver. 6.12.2 06/18/04 Search("Ver.|W", ADVANCE) if (Match("6.12.2") == 2) { // too old version (< 6.12.2) Message("Sorry, but this macro is written for at least VEDIT 6.12.2") Message("(Due to a bug in older versions. ") Message(" But it can be manually modified to work with older ones.)") return } Buf_Quit(OK) //------- Some user changeable configuration options: ----------------------------------- #98=0 // 0 = close the generated HTML files when finished // 1 = let the html-file(s) loaded after generating them Reg_Set(87,"\\VBOXSVR\vwin1\veditwebsite") // directory path for macros relative to the html files on website (not locally here!) Reg_Set(88, "macros") if (! File_Exist(@87)) { Buf_Switch(Buf_Free) Reg_Ins(87) Replace("\","\\", BEGIN+ALL+NOERR) Reg_Set(87, "Not found: ") Reg_Copy_Block(87, 0, File_Size, APPEND) Buf_Quit(OK) Message(@87) Get_Key() return } if (! File_Exist("|@(87)\|@(88)")) { #103=File_Mkdir("|@(87)\|@(88)", NOERR) if (#103 == 0) { Buf_Switch(Buf_Free) Reg_Ins(87) Ins_Text("\") Reg_Ins(88) Replace("\","\\", BEGIN+ALL+NOERR) Reg_Set(87, "Not created/found: ") Reg_Copy_Block(87, 0, File_Size, APPEND) Buf_Quit(OK) Message(@87) Get_Key() return } } // If the generated HTML files should be stored in a separate subdirectory, // it can be named here. But then you can't directly use the file-links in // those HTML files: they are pointing into their own directory, // and there are only the HTML files... // That way is only for temporary storage of the HTML files, assuming that // they are uploaded on the Web server into the same directory as the macro // files. Then the links are working fine again. // // TODO: check that carefully!!! And fix documentation! // //Reg_Set(89, "index.dir") // sub-directory for generated html-files //Reg_Set(89, "") // generate html-files into examined directory //Reg_Set(89, "..") // html-files into VEDIT home directory. So it can be tested offline as well. REALLY???? Reg_Set(89, "..\html") // is already done later. hopefully correct //if ( ! (File_Exist("..\html") and (File_Attrib("..\html") > 0) and (File_Attrib("..\html") & 16) )){ //} //----------------------------------------------------------- // Set the HTML-templates; used for the HTML generation later // // The key fields @HTMLTITLE@, @DESCRIPTION@, @NAME@ // and @DATE@ will be replaced with the current values. // Reg_Set(91, ` @HTMLTITLE@ `) Reg_Set(92, ' ') // Reg_Set(93, ' ') Reg_Set(94, '
Macro name Description @CATEGORY@ Last modification
 @NAME@
 @NAME@ @DESCRIPTION@
@FILEDATE@

') Reg_Set(95, ' ') Reg_Set(96, 'Categories:   (or full index by name or date) ') Reg_Set(97, 'Additionally to the files listed below there are these Sub-Categories: ') Reg_Set(98, '

Last change: @DATE@

') //======================================================================================== Key_Add(`Shft-F1`, `[VISUAL EXIT] if ((Reg_Size(100)==#90)&&(Buf_Num==#92)) { CALL(100, "SHOWHELP") } `, OK) Key_Add(`F11`, `[VISUAL EXIT] if ((Reg_Size(100)==#90)&&(Buf_Num==#92)) { #88=Cur_Line #89=Cur_Col CALL(100) Goto_Line(#88) Goto_Col(#89) }`, OK) Key_Add(`F12`, `[VISUAL EXIT] if ( Reg_Size(100)==#90) { #103=0 CALL(100, "LOADFILE") }`, OK) Key_Add(`Ctrl-F12`, `[VISUAL EXIT] if ( Reg_Size(100)==#90) { #103=1 CALL(100, "LOADFILE") }`, OK) Key_Add(`Alt-F12`, `[VISUAL EXIT] if ( Reg_Size(100)==#90) { CALL(100, "DELFILE") }`, OK) //--------------------------------------------------------------------------------------- Reg_Set(85, "*>") // marker for inactive entries #90=Reg_Size(100) // for checking whether $100 is unchanged (for F-keys) if ( ! Is_Open_Write) { #103=Dialog_Input_1(103, "`Problem`, `No definition file loaded. What to do?`, `[Load file]`,`[Create new]`,`[&Cancel]`",SET+APP+CENTER,0,0) if ((#103==0) || (#103==3)) { return } Reg_Set(86, "index.txt") // default name of the definition file if (#103==1) { // load a definition file repeat (ALL) { Get_Filename(86, "*.*", "Please choose an existing definition file", SET) if (Reg_Size(86)==0) { Visual_Macro(NOMSG) return } if (File_Exist("|@(86)")) { break } } } else { // create a definition file #104=Buf_Num Buf_Switch(Buf_Free) Reg_Ins(Macro_Num) BoF Search("|<__DATA__") Line(1) Del_Block(0,Cur_Pos) repeat (ALL) { Get_Filename(86, "*.*", "Please choose a path+filename to create a definition file", SET) if (File_Exist("|@(86)")) { #103=Dialog_Input_1(103, "`Problem`, `The file you have choosen to create already exists!`, `.\Should the existing file |@(86) be overwritten?`, `[Yes]`,`[No]`, `[Cancel]`",SET+APP+CENTER,0,0) if ((#103 == 3) || (#103 == 0)){ Buf_Quit(OK) Buf_Switch(#104) Visual_Macro(NOMSG) return } if (#103 == 1) { break } } else { break } } File_Save_As("|@(86)", OK+NOMSG) Reg_Set(86, PATHNAME) ChDir(PATH_ONLY) } } else { Reg_Set(104, EXT_ONLY) if (Reg_Compare(104, "VDM") == 0) { #103=Dialog_Input_1(103, "`Error!`, `The currently open file is a .VDM (macro). Not a definition file!`, `[&OK]`",SET+APP+CENTER,0,0) return } Reg_Set(86, PATHNAME) ChDir(PATH_ONLY) } // open the definition file #99=File_Check("|@(86)") if (#99 == -1) { Buf_Switch(#92=Buf_Free) File_Open("|@(86)", NOEVENT+CHGDIR) } else { Buf_Switch(#99) #92=Buf_Num Save_Pos() } Reg_Set(86, FILENAME) Config( PG_E_SYNTAX, "Enable syntax highlighting (*)", 1 ) Syntax_Load("xlist-mc2.syn", NOERR) Update() // Check whether all blocks are syntactically o.k. BoF Search("*|H7BMAIN:", NOERR) if (EM) { Dialog_Input_1(103,"`Error!`, `No MAIN tag found!`", WORKAREA+CENTER,0,0) return } else { Search("*MAIN|H7D", NOERR) if (EM) { Dialog_Input_1(103,"`Error!`, `No closing MAIN tag found!`", WORKAREA+CENTER,0,0) return } Search("*|H7BMAIN:", NOERR) if (!EM) { Dialog_Input_1(103,"`Error!`, `More than one MAIN tag found!`", WORKAREA+CENTER,0,0) return } } #103=0 #104=Buf_Num #105=Buf_Free BoF repeat(ALL) { Search("*|H7BSUB(|*):", ADVANCE+NOERR) if (EM) { // no opening tags found Search("*SUB|H7D", NOERR+ERRBREAK) // leave loop (o.k.) when also no closing tags if (!EM) { // but ending tags found Dialog_Input_1(103,"`Error!`, `Closing tag without opening tag.`", WORKAREA+CENTER,0,0) #103=1 break } } else { // at least one opening tag found #106=Cur_Pos Search("|{|X,:}", NOERR) Reg_Copy_Block(76, #106, Cur_Pos) // get name // check if valid filename Buf_Switch(Buf_Free) Reg_Ins(76) Search(`|{\,/,:,*,?,",<,>,||}`, BEGIN+NOERR) if (!EM) { Buf_Quit(OK) Dialog_Input_1(103,%`Error!`, `Invalid character(s): One of \/:*"?<>| \nName can't be used as filename.`%, WORKAREA+CENTER,0,0) #103=1 break } Buf_Quit(OK) Buf_Switch(#104) Search("*SUB|H7D", NOERR+ADVANCE) // search matching closing tag if (EM) { SR_Set("*|H7BSUB(|*):") Dialog_Input_1(103,"`Error!`, `Opening tag without closing tag.`", WORKAREA+CENTER,0,0) #103=1 break } // check for doubles Buf_Switch(#105) Search("|@(76)", BEGIN+NOERR) if (!EM) { Buf_Switch(#104) Goto_Pos(#106) Update() SR_Set("*|H7BSUB(|*):|@(76)") Dialog_Input_1(103,"`Error!`, `Double block name |@(76) found.`", WORKAREA+CENTER,0,0) #103=1 break } Reg_Ins(76) Ins_Newline(1) Buf_Switch(#104) } } Buf_Switch(#105) Buf_Quit(OK) Buf_Switch(#104) if (#103) { // on error above return } // some formatting Replace("|W|>","",BEGIN+ALL+NOERR) // delete trailing whitespace // check target directory for HTML-files if (Reg_Size(89) > 0) { if (File_Exist("|@(89)", NOERR)==0) { // o.k.??? To do: check for trailing backslash! No one here! File_MkDir("|@(89)") } } // ------------------------------------------------------------------------ #95=Buf_Switch(Buf_Free) // for alphabetic Ins_Newline(1) #96=Buf_Switch(Buf_Free) // and list per date Ins_Newline(1) #85=Buf_Switch(Buf_Free) // for temp. work Ins_Newline(1) // get the list of files in the directory if (#91=File_Check("|(VEDIT_TEMP)\xlist-mc.tmp") != -1) { Buf_Switch(#91) BoF Del_Line(ALL) } else { Buf_Switch(#91=Buf_Free) File_Save_As("|(VEDIT_TEMP)\xlist-mc.tmp", OK+NOMSG) } Out_Ins() Dir("*.*",NOMSG+SUPPRESS) Out_Ins(CLEAR) Replace("|W|>","",BEGIN+ALL+NOERR) // delete trailing whitespace Replace("|<|*.bak|N","",BEGIN+ALL+NOERR) // delete entries of *.bak files // ----- // check all files in the directory if they are in the definition file too Buf_Switch(#91) BoF while (! At_EoF) { Reg_Copy_Block(103, Cur_Pos, EoL_Pos) // current filename Buf_Switch(#92) Search("|<|@(103)", BEGIN+NOERR) // is the file as active entry in definition file? if (!EM) { // if yes //Char(Chars_Matched) Reg_Ins(103, OVERWRITE) // to set the correct upper/lower case // To do: o.k. if doubles are allowed!? // // if (Search("|<|@(103)", BEGIN+ALL+NOERR) > 1) { // search for active doublettes // Win_Clear() // Message("\nAttention: There are some files with more than one active entry!\n") // Message("----------------------------------------------------------------\n\n") // } // // To do: check! I fear that's not working o.k. // while (Search("|<|@(103)", BEGIN+ALL+NOERR) > 1) { // search for active doublettes // Message(">> ") // Reg_Type(103) // Message(` << has more than one active entry. Double is set to inactive.\n`) // BoL // Reg_Ins(85) // Ins_Text(" [2x] ") // } } else { // if not found as active entry Search("|<|@(85)|[|W]|@(103)", BEGIN+NOERR) // check if it's an inactive entry if (!EM) { // if yes Del_Char(Reg_Size(85)) // switch from inactive to active state Replace("|<|W", "", NOERR) Reg_Ins(103, OVERWRITE) // to set the correct upper/lower case } else { // if no Search("|<*|*|@(103)", BEGIN+NOERR) // check if it's an commented out entry if (EM) { // if no Search("|<|@(85)|[|W]*|*|@(103)", BEGIN+NOERR) // check if it's an inactive commented out entry if (EM) { // if absolutely not there => append it there EoF Reg_Ins(103) Ins_Newline(1) } } } } Buf_Switch(#91) Line(1, NOERR) } BoF // ----- // check all files in the definition file if they are existing in file list; if not mark the entry as inactive Buf_Switch(#92) BoF while(! At_EoF) { #103=Cur_Pos // To do: check inactive entries again if (Match("|{|X,*}") != 0) { // if not an inactive entry line or comment or so Search("|{:,|X}", NOERR) if (EM || At_BoL) { // if no filename in that line BoL Reg_Ins(85) Ins_Text(" ") } else { Reg_Copy_Block(103, #103, Cur_Pos) // current filename Buf_Switch(#91) Search("|@(103)", BEGIN+NOERR) // search this one in directory list Buf_Switch(#92) if (EM) { // if file not existing in directory list BoL Reg_Ins(85) Ins_Text(" ") Line(1, NOERR) while (Match("|X") == 0) { Reg_Ins(85) Ins_Text(" ") Line(1, NOERR) } } } } Line(1, NOERR) } // --- // get html-title (if any) Reg_Empty(90) Search("|<*|H7BTITLE:|[|W]", BEGIN+ADVANCE+NOERR) if (!EM) { #103=Cur_Pos Search("|H7D", NOERR) // exclude closing curly brace Reg_Copy_Block(90, #103, Cur_Pos) } BoF //------------------------------ Buf_Switch(#92) // definition file BoF while (Search("|<|[*]|[>]|[|W]|@(86).#|D|D", NOERR) > 0) { // remove temp. working files of definition file BoL //Reg_Copy(75, 1, APPEND+DELETE) Del_Line(1) } //------------------------------------------------------------------------ // loop through the blocks in the definition file Buf_Switch(#94=Buf_Free) // BlockList Ins_Text("MAIN") Ins_Newline(1) BoF repeat(ALL) { Buf_Switch(#94) // BlockList BoF if (At_EoF) { // exit if no more entries (To do: is that safe???) Buf_Quit(OK) Buf_Switch(#92) // definition file break } Case_Lower_Block(Cur_Pos, EoL_Pos) // change to lower case (for filename) To do!? Search_Block(":", Cur_Pos, EoL_Pos, NOERR) // if (EM) { Reg_Set(79, "MAIN") Reg_Copy_Block(82, Cur_Pos, EoL_Pos) // block name } else { EoL Search(":", REVERSE+ADVANCE) Reg_Copy_Block(79, BoL_Pos, Cur_Pos-1) // "path" Reg_Copy_Block(82, Cur_Pos, EoL_Pos) // block name Char(-1) #103=Cur_Pos Search("|{:,|<}", REVERSE) if (!At_BoL) { Char(1) // skip colon } } BoL Del_Line(1) // and delete it from list //--- // get the complete text of that block (without the tags) Buf_Switch(#92) // definition file if (Reg_Compare(82, "MAIN") == 0) { Search("*|H7BMAIN:", BEGIN+ADVANCE) #103=Cur_Pos Search("*MAIN|H7D") } else { // Search("*|H7BSUB(|@(79))):|@(82)", BEGIN+ADVANCE+NOERR+ERRBREAK) // !!! Bug! ==> add. ")" for VEDIT < 6.12.2 Search("*|H7BSUB(|@(79)):|@(82)", BEGIN+ADVANCE+NOERR+ERRBREAK) // for VEDIT >=6.12.2 // To do: errbreak o.k.???? Match(":", NOERR+ADVANCE) // skip colon Match("|W", NOERR+ADVANCE) // skip whitespace #103=Cur_Pos Search("*SUB|H7D") } #104=Cur_Pos // complete text of this block Goto_Pos(#103) #105=Match("|X") // s.th. up to EoL? Clip_Copy_Block(#103, #104) // To Do: what if too big? Goto_Pos(#104) Line(1, NOERR) Save_Pos() // remember position of next line after closing tag File_Open("|@(89)\|@(82).html", NOEVENT) // current/new HTML-File #93=Buf_Num BoF Del_Line(ALL) // delete contents Clip_Ins() // and fill in block BoF if (#105) { Ins_Text("

") EoL Ins_Text("

") Line(1, NOERR) while (Match("|<|N") == 0 ) { // remove empty lines // To do: o.k. ? Del_Line(1) } BoF Line(1) } Clip_Copy_Block(0,0) // clear Clipboard again // Replace("|<|W","", BEGIN+ALL+NOERR) // remove leading whitespace // Replace("|N|[|W]_|[|W]"," ", BEGIN+ALL+NOERR) // remove line continuations incl. CR/LF // Replace("|N","
", BEGIN+ALL+NOERR) // replace NewLines with
Call ("FORMATBLOCK") // format the description in T-Reg 71 BoF Reg_Ins(91) // HTML-header at BoF if (Reg_Compare(82, "MAIN") == 0) { // on main page EoF Ins_Newline(1) Ins_Text("
") // horiz. line Ins_Newline(1) Reg_Ins(96) // "Categories:" } else { Call("CREATE_HIST_LINK") // (inp: @79) Reg_Ins(103) EoF Ins_Text("
") // horiz. line Ins_Newline(1) // Reg_Ins(97) // "Sub-Categories:
" } Ins_Text("") Ins_Newline(1) if (#86==0) { // no SUB's found and listed #103=Cur_Pos Search("
", REVERSE) Del_Block(Cur_Pos, #103) // remove this (empty) part } Ins_Text("
") // horiz. line Ins_Newline(1) // loop through the file entries Buf_Switch(#92) // definition file Restore_Pos() // just after current block-header (BoL) Reg_Empty(77) // To do: what if too many entries below? (T-Reg size) while (Match("*|H7BSUB") != 0) { // until next tag reached => end if (Match("*|!|{|H7BTAB}") != 0) { // valid entry? // |{...,|>} : empty lines are allowed now Reg_Copy(77, 1, APPEND) // collect all lines } Line(1, NOERR+ERRBREAK) } if (At_EoF && !At_BoL) { Ins_Newline(1) } while (Match("*") == 0) { // try to find end of above block Line(-1, NOERR) // To do: that's not foolproof if (Match("*|{SUB,MAIN}|H7D")==0) { // if (Match("*") == 0) { // Line(1) // } break } } if (Match("|<|>") != 0) { Line(1, NOERR) } Reg_Ins(75) // saved entry/ies of HTML-file itself Buf_Switch(#93) // HTML-file EoF // create tables in HTML Buf_Switch(Buf_Free) Reg_Ins(77) // list of file entries // To do: some formatting? #87=0 // counter for files Reg_Set(73, "*") // for switch-detection Reg_Empty(72) // name of sub-table BoF while (! At_EoF) { if (Match("*|H7BTAB:", ADVANCE) == 0) { #103=Cur_Pos Search("|{|H7D,|>}") Reg_Copy_Block(72, #103, Cur_Pos) // table name BoL Del_Line(1) continue } if (Match("*>") == 0) { // ignore inactive entries Del_Line(1) continue } if (Match("|N") == 0) { // ignore empty lines Del_Line(1) continue } if (Match("|@(82)|[-xa,-xd].html|[.#|D|D]") == 0) { // ignore entry of HTML file itself Del_Line(1) continue } // if (Match("|@(86).#|D|D") == 0) { // ignore entry of index file itself; To do: o.k. here ??? // Del_Line(1) // continue // } if (Match("|W") != 0) { // at filename #87++ #104=Cur_Pos Search_Block("|[|W]:", Cur_Pos, EoL_Pos, NOERR) // To do: filenames with spaces :-( (and entries without colon) if (EM) { // if no colon found Search("|{|X,|>}") // assume whitespace as end of filename (or EoL) Reg_Copy_Block(83, BoL_Pos, Cur_Pos) // filename Match("|W", ADVANCE) } else { Reg_Copy_Block(83, BoL_Pos, Cur_Pos) // filename Char(Chars_Matched) } #103=Cur_Pos // start of descr. (if any) Line(1, NOERR) while (Match("|{|W,|N}") == 0) { // To do: o.k. ? Line(1, NOERR+ERRBREAK) } Reg_Copy_Block(71, #103, Cur_Pos-Newline_Chars) Del_Block(#104, Cur_Pos) // delete current entry if (Reg_Compare(73, @(72)) != 0) { // if sub-table name changed if (Reg_Compare(73, "*") != 0) { // if not initial Reg_Ins(94) // table footer } Save_Pos() //Ins_Text("
") Reg_Ins(92) // table header if (Reg_Size(72) > 0) { Replace("@CATEGORY@", "  (Group: |@(72))", REVERSE) // write table-name } else { Replace("@CATEGORY@", "", REVERSE) // no table-name } Restore_Pos() Reg_Set(73, @72) } Reg_Ins(93) // table row Save_Pos() Reg_Empty(84) File_Stamp_String(84, @83, REVERSE) Replace("@FILEDATE@", "|@(84)", REVERSE) // filedate Char(Reg_Size(84)) // remove time Del_Char(-9) // remove time Replace("@LASTMODCOLOR@", "", REVERSE) // To do! Replace("@DESCRIPTION@", "", REVERSE) // description //Char(1) // just after the above replace #106=Buf_Num Buf_Switch(#85) // temp. buffer Del_Block(0, File_Size) Reg_Ins(71) Call ("FORMATBLOCK") // format the description in T-Reg 71 Reg_Copy_Block(71, 0, File_Size) Buf_Switch(#106) Reg_Ins(71) // description Char(-4) while (Match("
") == 0) { Del_Char(4) Char(-4) } Char(4) Ins_Text(" ") // to allow table field with empty description Replace("@NAME@", "|@(83)", REVERSE+COUNT,1) // filename Replace("@PATH+NAME@", "|@(88)/|@(83)", REVERSE+COUNT,1) // path/filename Restore_Pos() #105=Buf_Num Buf_Switch(#95) // alphabetic list Reg_Ins(83) // filename Ins_Text(" : ") Reg_Ins(82) // SUB-name Ins_Text(" : ") Reg_Ins(84) // date Ins_Newline(1) Buf_Switch(#96) // list by date Reg_Ins(84) // date Ins_Text(" : ") Reg_Ins(83) // filename Ins_Text(" : ") Reg_Ins(82) // SUB-name Ins_Newline(1) Buf_Switch(#105) } } if (#87 > 0) { Reg_Ins(94) // table footer } BoF Reg_Copy_Block(74, 0, File_Size) Buf_Quit(OK) Buf_Switch(#93) // HTML-file EoF Reg_Ins(74) // generated table(s) of file-links if (#87 > 0) { Ins_Text("
") Ins_Newline(1) Ins_Text("
") // horiz. line Ins_Newline(1) } if (Reg_Compare(82, "MAIN") == 0) { // on main page Reg_Ins(98) // text for modification date Save_Pos() Search("@DATE@", REVERSE) Del_Char(6) Out_Ins() Date(REVERSE+NOCR+NOMSG) // yyyy-mm-dd Out_Ins(CLEAR) Restore_Pos() } if (#87 > 0) { Call("CREATE_HIST_LINK") // inp: @79 Reg_Ins(103) Ins_Text("
") } Reg_Ins(95) // HTML-footer Replace("@HTMLTITLE@", "|@(90)", BEGIN) if (#87 > 0) { if (Reg_Compare(82, "MAIN") != 0) { // not on main page Search("|<