! ! ! ***** PRINT_BUFFER ***** ! ! The 3 following procedures copy the current buffer to another buffer, ! translate control characters to readable characters and write the ! new buffer. It then submits the file to the specified print queue (default ! SYS$PRINT). ! ! This procedure calls the other two and creates sends the print command ! to the DCL subprocess to print the file. ! PROCEDURE decus$print_buffer ! Procedure to print the current buffer. LOCAL write_result, ! File name string returned by write_file temp, ! Save passed filename this_position, this_buffer, buffer_name, file_name, print_command, print_process; SET (informational,off); SET (success,off); this_position := MARK (none); this_buffer := CURRENT_BUFFER; decus$search_controls (this_buffer); ! Translate control characters. if eve$x_trimming then eve$trim_buffer (this_buffer); endif; temp := GET_INFO (this_buffer,"output_file"); if temp = 0 then temp := FILE_PARSE (GET_INFO(this_buffer,"name"),".LIS"); else temp := FILE_PARSE (SUBSTR (temp,1,INDEX (temp,";")),".LIS"); endif; write_result := WRITE_FILE (translate_buffer, temp); SET (output_file, translate_buffer, write_result); print_command := "PRINT/NOTIFY/HEADER/FLAG "; fred$hidden_subprocess (print_command + write_result); MESSAGE (FAO ("Printing !AS with command !AS.",write_result,print_command)); SET (informational,on); SET (success,on); UPDATE (message_window); POSITION (this_position); ENDPROCEDURE; ! This procedure controls the outer loop search for the special ! control characters that we want to view ! PROCEDURE decus$search_controls (this_buffer) LOCAL control_char_pat, control_char; ! When the search fails we know that we have either hit the end of ! the buffer or there were no more special characters found. on_error POSITION (translate_buffer); RETURN; endon_error; if GET_INFO (translate_buffer,"type") = UNSPECIFIED then translate_buffer := CREATE_BUFFER ('translation'); SET (no_write, translate_buffer); endif; control_char_pat := ANY (''); POSITION (translate_buffer); ERASE (translate_buffer); COPY_TEXT (this_buffer); ! Make a copy of the original buffer POSITION (BEGINNING_OF (translate_buffer)); loop ! Find all occurrences control_char := SEARCH (control_char_pat, forward); POSITION (control_char); ERASE (control_char); ! then erase it decus$translate_controls (CURRENT_CHARACTER); ! Substitute the new text endloop; ENDPROCEDURE;