procedure eve_mail_a_buffer local address, ! TO field for MAIL subject, ! Subject field for MAIL this_buffer, ! Buffer to be sent this_position, ! Current location in buffer temp; ! Used to construct MAIL command ! This procedure will send MAIL using the DCL subprocess started by EVE. ! If the subprocess does not exist, it will be created. It prompts for ! the TO and SUBJECT fields, and then mails the CURRENT_BUFFER as the text ! of the MAIL message. ! Author: Allen A. Watson, The Record, Hackensack, NJ 07602. address := read_line("To: "); subject := read_line("Subject: "); ! Make sure EVE's DCL process exists. if (get_info (eve$x_dcl_process, "type") = unspecified) or (eve$x_dcl_process = 0) then message ("Creating DCL subprocess..."); eve$x_dcl_process := create_process (eve$dcl_buffer, "$ set noon"); endif; this_buffer := current_buffer; this_position := mark (none); if this_buffer <> eve$dcl_buffer then if eve$x_number_of_windows >= 2 then eve_other_window; if current_buffer <> eve$dcl_buffer then map (current_window, eve$dcl_buffer); endif; else unmap (eve$main_window); map (eve$top_window, this_buffer); eve$set_status_line (eve$top_window); update (eve$top_window); map (eve$bottom_window, eve$dcl_buffer); eve$x_number_of_windows := eve$x_number_of_windows + 1; eve$x_this_window := eve$bottom_window; endif; endif; set (status_line, current_window, reverse, " DCL buffer"); position (end_of (eve$dcl_buffer)); ! Process the DCL string - need to include the $ write_file(this_buffer,"EVE_MAIL.TMP"); if substr(address,1,1) = "@" then temp := '$MAIL/SUBJECT="' + subject + '" EVE_MAIL.TMP "' + address + '"'; else temp := '$MAIL/SUBJECT="' + subject + '" EVE_MAIL.TMP ' + address; endif; split_line; copy_text("! Executing...please wait for completion"); split_line; copy_text (temp); update(current_window); send(temp, eve$x_dcl_process); position (end_of (eve$dcl_buffer)); copy_text("$ DELETE EVE_MAIL.TMP;*"); split_line; copy_text("MAIL message sent"); position (end_of (eve$dcl_buffer)); send("$ DELETE EVE_MAIL.TMP;*",eve$x_dcl_process); update (current_window); if this_buffer <> eve$dcl_buffer then eve_other_window; endif; return (1); endprocedure;