[inherit('sys$library:starlet','lib$spawn','smgdefs','smg$repaint_line',
'BB.PEN')]
module add_menu;

[global] 
procedure add_menu;

{Add an existing file or use EDT to create a new file to add to local
 database or to send over the internet.}

var
  add_option : char;

begin
  m_menu := false;
  adjust := false;   {Will change to true if message(s) added to
                      local data base.}
  repeat
    {A carriage return to the next query sends the user back to the
     message menu.}
    write_menu('Destination options:',
               ' Internet Local | <CR> for previous menu');
    destination_option:=getchar;
    smg$unpaste_virtual_display(error_display,pasteboard);

    if (destination_option in ['I','L']) then
      repeat
        {Query the user for adding a file or using the editor to
         create a file to add to the data base or send over the
         internet.  A carriage return will send the user back to
         the 'Internet Local' query.}
        write_menu('Message type options:',
                   ' Edit File | <CR> for previous menu');
        add_option := getchar;
        smg$unpaste_virtual_display(error_display,pasteboard);
        case add_option of
          'E' : add_edit;
          'F' : add_file;
        otherwise
        end;
      until not (add_option in ['E','F']);
  until not (destination_option in ['I','L']);

end;
end.
