// INSHTML - Convert a text file into an HTML file. // // Author: Scott Lambert // Last change: 8/97 // hacked by Fritz Heberlein, 10/99 // rehacked by Scott Lambert 10/99 // Requires: VEDIT 5.01 or later. // // Description: Starts the process of converting a file to a HTML file. // Prompts on the status line for the title. // // See also: INSHTML.VDM converts a file into a HTML file. // // From OS: vedit -x inshtml filename (Where 'filename' is your file.) // // From VEDIT: Select {MISC, Load/Execute macro}. Enter filename // "inshtml.vdm". Use default register number "100". // // OR: Run this macro as a keystroke macro, e.g. . One way // is by adding the following line to STARTUP.VDM: // // Key_Add("Shft-F5",'[VISUAL EXIT] Call_File(122,"inshtml.vdm")',OK) // // OR: Add this function to the {USER} menu by adding these lines // to USER.MNU: // // 1 // Add HTML // CallF(122,"inshtml.vdm") // // Resources: T-Reg 103 // // I. Delete file extension: // #81=0 // set error flag to 0 for OK #80=BufNum // Save buffer number of input file regset(11,pathname) // read pathname + filename into @11 if(reg_size(11)==0) {#81=1} // if buffer has no filename set error flag to 1 If(#81==0) { // if still ok lets do it Bufswitch(Buf_Free) // switch to a free buffer regins(11) // insert filename from @98 BOF() // go to begin of file s(".") // search for the dot rcb(10,BOL_Pos,cur_pos) // copy 'bare' filename to @10 BufQuit(ok) } // II. Translate file to ansi if working with DOS version buf_switch(#80) if(OS_Type==2){ translate_load("ansi.tbl") translate_block(0,filesize) } // III. Insert html tags BOF() ins_text(& &) get_input(103,"HTML Title =",statline+nocr) reg_ins(103) ins_text(&
&)

end_of_file()

ins_text(&
&) // IV. Save input file as *.htm file: if(#81==0) { Bufswitch(#80) filesaveas("|@(10).htm",ok+begin) } return