PROCEDURE EVE_SEL2RNO ! ! This procedure will take a SELECT (word processor on a Rainbow) formatted ! file after transfer to the VAX from a Rainbow and convert the file from ! SELECT format to RUNOFF (DSR). ! Local this_line, this_range, my_range_begin, my_range_end, tocb, old_mode, this_buf_name, new_file_name; ! create the .RNO file and copy the current file into it... this_buf_name := get_info (current_buffer, "name"); new_file_name := (file_parse (get_info (current_buffer, "name"), "", "", node, device, directory, name)) + ".RNO"; eve_get_file (new_file_name); eve_include_file (this_buf_name); old_mode := get_info (current_buffer, "mode"); set (INSERT, current_buffer); message ("Converting SELECT file to RUNOFF format"); split_line; ! insert a new line copy_text (".flags bold"); ! set up for bold (if any) split_line; ! insert a new line position (beginning_of(current_buffer)); ! reposition to top tocb := mark (none); ! and mark the position ! ! WARNING: Do NOT change the order in which the following statements appear. ! To do so will result in an invalid output file ! ! begin 1st search/replace ! right margin pce_unconditional_replace_all ("\r", ".rm"); position (tocb); ! left margin pce_unconditional_replace_all ("\l", ".lm"); position (tocb); ! blank line(s) pce_unconditional_replace_all ("\b", ".b "); position (tocb); ! hard page pce_unconditional_replace_all ("\e", ".page"); position (tocb); ! ampersand(s) -- 2 step procedure pce_unconditional_replace_all ("&", "~"); position (tocb); ! bolding loop exitif pce_unconditional_replace ("^", "^*") = 0; exitif pce_unconditional_replace ("^", "\*") = 0; endloop; position (tocb); ! underlining loop exitif pce_unconditional_replace ("_", "^&") = 0; exitif pce_unconditional_replace ("_", "\&") = 0; endloop; position (tocb); ! ampersand(s) -- 2nd part of 2 step procedure pce_unconditional_replace_all ("~", "_&"); position (tocb); ! pound sign(s) pce_unconditional_replace_all ("#", "_#"); position (tocb); ! hard space(s) pce_unconditional_replace_all ("\/", "#"); position (tocb); ! get rid of tab cmd loop this_range := search_quietly ("\t", current_direction, no_exact); exitif this_range = 0; position (this_range); erase_line; endloop; position (tocb); ! get rid of \c (???) loop this_range := search_quietly ("\c", current_direction, no_exact); exitif this_range = 0; position (this_range); erase_line; endloop; position (tocb); ! get rid of indent cmd loop this_range := search_quietly ("\i", current_direction, no_exact); exitif this_range = 0; position (this_range); erase_line; endloop; position (tocb); ! center (only centers the first line of a center range) loop this_range := search_quietly ("\jc", current_direction, no_exact); exitif this_range = 0; position (this_range); erase_line; eve_cut_leading; copy_text (".center;"); endloop; position (tocb); ! nojustification loop this_range := search_quietly ("\jn", current_direction, no_exact); exitif this_range = 0; position (this_range); erase_line; copy_text (".nofill"); split_line; copy_text (".nojustify"); split_line; endloop; position (tocb); ! ragged right loop this_range := search_quietly ("\jl", current_direction, no_exact); exitif this_range = 0; position (this_range); erase_line; copy_text (".fill"); split_line; copy_text (".nojustify"); split_line; endloop; position (tocb); ! blocked text loop this_range := search_quietly ("\jr", current_direction, no_exact); exitif this_range = 0; position (this_range); erase_line; copy_text (".fill"); split_line; copy_text (".justify"); split_line; endloop; position (tocb); set (old_mode, current_buffer); message ("Conversion completed..."); ENDPROCEDURE;