DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦4c8a164a8⟧ TextFile

    Length: 2152 (0x868)
    Types: TextFile
    Names: »B«

Derivation

└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─ ⟦129cab021⟧ »DATA« 
        └─⟦this⟧ 
└─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04
    └─ ⟦d65440be7⟧ »DATA« 
        └─⟦this⟧ 

TextFile

WITH Io;
WITH Messages;
WITH Mailboxes;
WITH Destinations;
WITH Command_Utilities;
WITH System_Utilities;

PROCEDURE Run_Mail (User_Name : String := "<Current_User>") IS

   PACKAGE Cu RENAMES Command_Utilities;

   Mailbox      : Mailboxes.Mailbox := Mailboxes.Make;
   Command      : Cu.Command;
   Message      : Messages.Message;
   Current_User : Destinations.User;

   FUNCTION Get_User (Name : String) RETURN String;

   FUNCTION Get_User (Name : String) RETURN String IS
   BEGIN
      IF Name = "<Current_User>" THEN
         RETURN System_Utilities.User_Name;
      ELSE
         RETURN Name;
      END IF;
   END Get_User;

BEGIN

   BEGIN
      Current_User := Destinations.Lookup (Get_User (User_Name));
   EXCEPTION
      WHEN Destinations.Undefined =>
         Io.Put_Line ("Sorry, can only run simulation for current user.");
         RETURN;
   END;

   LOOP
      Command := Cu.Get_Command;
      CASE Command.Kind IS

         WHEN Cu.Headers =>
            Cu.Display_Headers (Mailbox);

         WHEN Cu.Read =>
            Cu.Display_Message (Mailboxes.Get_Message
                                   (Command.Message, Mailbox));
            Mailboxes.Set_Read_Flag (Command.Message, True, Mailbox);

         WHEN Cu.Send =>
            BEGIN
               Message := Cu.Get_Message;
               Messages.Set_From (Current_User, Message);
               Mailboxes.Add (Message, Mailbox);
               Cu.Notify_Of_Receipt (Current_User, Messages.Get_To (Message));
            EXCEPTION
               WHEN Destinations.Undefined =>
                  Io.Put_Line ("Sorry, undefined user name entered.");
            END;

         WHEN Cu.Delete =>
            Mailboxes.Delete_Message (Command.Message, Mailbox);

         WHEN Cu.Quit =>
            EXIT;

         WHEN Cu.Unknown =>
            Io.Put_Line ("Unknown command entered.  Please try again.");
            Io.Put ("Legal commands are: ");
            FOR I IN Cu.Headers .. Cu.Quit LOOP
               Io.Put (Cu.Command_Kind'Image (I));
               Io.Put (' ');
            END LOOP;
            Io.New_Line;

      END CASE;
   END LOOP;

END Run_Mail;