! TITLE CVTHELP.TPU ! IDENT 01-000 ! !++ ! ! Program: CVTHELP.TPU ! ! Author: Hunter Goatley ! Copyright © 1994, MadGoat Software. All rights reserved. ! ! Date: January 12, 1992 ! ! Purpose: Convert .HELP files to RUNOFF .RNH files. Substitutes ! RUNOFF commands for tags imbedded in the .HELP file. ! ! Calling sequence: ! ! $ EDIT/TPU/NOJOURNAL/NODISPLAY/COMMAND=CVTHELP file.HELP ! ! Modified by: ! ! 01-000 Hunter Goatley 12-JAN-1992 15:15 ! Original version. ! !-- Procedure eve_convert_help Local temp ,x ; qualifier_level := 0; hg$substitute_topic(current_buffer, "
", ".indent-3", "1"); hg$substitute_topic(current_buffer, "", ".indent-3", ""); hg$substitute_topic(current_buffer, "", ".indent-3", "2"); hg$substitute_topic(current_buffer, "", ".indent-3", "3"); hg$substitute_topic(current_buffer, "", ".indent-3", "4"); hg$substitute_comment(current_buffer,"",".noflags;.lm3;.rm70"); hg$substitute_comment(current_buffer,"",".lm+4;.literal"); hg$substitute_comment(current_buffer,"",".end literal;.lm-4"); hg$substitute_comment(current_buffer,"",'.list 1,"o"'); hg$substitute_comment(current_buffer,"",'.list 0,"o"'); hg$substitute_comment(current_buffer,"",".le"); hg$substitute_comment(current_buffer,"",".end list"); hg$substitute_comment(current_buffer,"
",".center"); hg$substitute_comment(current_buffer,"",".sk;.indent2"); hg$substitute_comment(current_buffer,"",".note"); hg$substitute_comment(current_buffer,"",".end note"); hg$substitute_comment(current_buffer, LINE_BEGIN & LINE_END,".sk"); hg$substitute_comment(current_buffer, LINE_BEGIN & "|", ""); EndProcedure; ! eve_convert_help Procedure hg$substitute_comment (the_buffer, target, new) Local temp ,save_pos ,x ; on_error; endon_error; save_pos := mark(none); position(beginning_of(the_buffer)); loop x := search(target, forward); exitif x = 0; position (x); erase_character(length(x)); copy_text(new); endloop; position(save_pos); EndProcedure; ! hg$substitute_comment Procedure hg$substitute_topic (the_buffer, target, new, level) Local temp ,save_pos ,x ; on_error; endon_error; save_pos := mark(none); position(beginning_of(the_buffer)); loop x := search(target, forward); exitif x = 0; position (x); erase_character(length(x)); move_vertical(-1); if (length(current_line) = 0) then copy_text("|"); endif; move_vertical(1); copy_text(".!------------------------------------------------------"); split_line; copy_text(new); move_horizontal(-current_offset); move_vertical(1); if level <> "" then copy_text(level + " "); else if qualifier_level = 0 then copy_text("2 Qualifiers"); split_line; split_line; copy_text(new); split_line; qualifier_level := 1; endif; endif; move_horizontal(-current_offset); move_vertical(1); if length(current_line) = 0 then copy_text(".sk"); endif; endloop; position(save_pos); EndProcedure; ! hg$substitute_topic !=============================================================================== Procedure tpu$init_procedure Local temp ,orig_filespec ,f ; on_error endon_error; !Prompt user for information orig_filespec := get_info(command_line, "file_name"); if orig_filespec = "" then message("No .HELP file given"); quit; endif; f := file_parse(orig_filespec, ".HELP"); !Add .LIS ending ! Create a buffer and window for editing main_buf := create_buffer ("MAIN",f); set (eob_text, main_buf, "[End of buffer]"); position (beginning_of(main_buf)); eve_convert_help; f := file_parse(orig_filespec,"","",NAME); write_file (main_buf, f+".RNH"); quit; EndProcedure; !TPU$INIT_PROCEDURE tpu$init_procedure;