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 - metrics - download
Index: B T

⟦c91b6f7e0⟧ TextFile

    Length: 7971 (0x1f23)
    Types: TextFile
    Names: »B«

Derivation

└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
    └─⟦5cb1d1d7f⟧ »DATA« 
        └─⟦3b1ee7bd8⟧ 
            └─⟦this⟧ 

TextFile

separate (Tracker.Personnel_Pkg)

procedure Pr_Add is
    ------------------------------------------------------------------------------
    --|
    --|  NAME:  PR_ADD
    --|
    --|  OVERVIEW:
    --|    This procedure sets up the record to be added to the list by
    --|    user prompt/response.  The function calls to Prompt_Pkg return
    --|    only valid existing data.  The complete record is
    --|    then added to the linked list by calling the generic list procedure
    --|    ADD.
    --|
    --|  EXCEPTIONS HANDLED:
    --|    none
    --|
    --|  HISTORY:
    --|    written by   May Lee   March 1985
    --|
    --|  NOTES:
    --|    The number of people is incremented in this procedure.
    --|
    ------------------------------------------------------------------------------
    A_Char : Character := ' ';
    Pr_Record : Personnel_Pointer;

begin
    -- create a null personnel record
    Pr_Record := new Personnel_Type;

    New_Line;
    Put_Line (" If you would like more information on the type of data ");
    Put_Line (" to enter for any of the following questions, enter a '?'");
    Put_Line (" Otherwise, enter the data requested.      ");
    New_Line (2);

    --  get the record fields
    Pr_Record.Name := Prompt_Pkg.Persons_Name;
    Pr_Record.Initials := Prompt_Pkg.New_Person_Initials;
    Pr_Record.Production_Rate := Prompt_Pkg.Pr_Production_Rate;
    Pr_Record.Hours_Per_Week := Prompt_Pkg.Pr_Hrs_Per_Week;
    Put_Line (" What is this person's start date? ");
    Pr_Record.Start_Dates (1) := Prompt_Pkg.Date;

    -- Get stop date
    loop
        -- until valid stop date
        New_Line;
        Put_Line (" What is this person's stop date? ");
        Pr_Record.Stop_Dates (1) := Prompt_Pkg.Date;

        -- check if valid stop date
        if Pr_Record.Stop_Dates (1) = Null_Date then
            for I in Dates_List'First + 1 .. Dates_List'Last loop
                Pr_Record.Start_Dates (I) := Null_Date;
                Pr_Record.Stop_Dates (I) := Null_Date;
            end loop;

            exit;
        elsif (Pr_Record.Stop_Dates (1) /= Null_Date) and
              (Pr_Record.Start_Dates (1) /= Null_Date) and
              (Pr_Record.Stop_Dates (1) < Pr_Record.Start_Dates (1)) then
            Put_Line
               (" That is not a valid stop date.  The stop date must be ");
            Put_Line (" a later date than the start date.  TRY AGAIN!  ");
            Put (" The start date is ");
            Put (Pr_Record.Start_Dates (1).Month, 2);
            Put ('/');
            Put (Pr_Record.Start_Dates (1).Day, 2);
            Put ('/');
            Put (Pr_Record.Start_Dates (1).Year, 4);
            New_Line;
        else
            exit;
        end if;
    end loop;

    -- if not null, ask if user wants to add more start/stop dates
    if Pr_Record.Stop_Dates (1) /= Null_Date then
        Start_Stop_Dates_Loop:
            for I in Dates_List'First + 1 .. Dates_List'Last loop
                New_Line;
                Put_Line
                   (" Would you like to add another set of start/stop dates? ");
                Put (" [y or n, <cr>=n] : ");

                if End_Of_Line then
                    Skip_Line;
                    exit Start_Stop_Dates_Loop;
                else
                    Get (A_Char);
                    Skip_Line;

                    if A_Char = 'y' or A_Char = 'Y' then
                        Start_Date_Loop:
                            loop
                                -- until valid start date
                                New_Line;
                                Put_Line
                                   (" What is this person's start date? ");
                                Pr_Record.Start_Dates (I) := Prompt_Pkg.Date;
                                -- check if valid start date

                                if Pr_Record.Start_Dates (I) = Null_Date then
                                    for J in I .. Dates_List'Last loop
                                        Pr_Record.Start_Dates (J) := Null_Date;
                                        Pr_Record.Stop_Dates (J) := Null_Date;
                                    end loop;

                                    exit Start_Stop_Dates_Loop;
                                elsif Pr_Record.Start_Dates (I) <
                                      Pr_Record.Stop_Dates (I - 1) then
                                    Put_Line
                                       (" That is not a valid start date.  The start date must be ");
                                    Put_Line
                                       (" a later date than the previous stop date.  TRY AGAIN!  ");
                                    Put (" The previous stop date is ");
                                    Put (Pr_Record.Stop_Dates (I - 1).Month, 2);
                                    Put ('/');
                                    Put (Pr_Record.Stop_Dates (I - 1).Day, 2);
                                    Put ('/');
                                    Put (Pr_Record.Stop_Dates (I - 1).Year, 4);
                                    New_Line;
                                else
                                    -- valid start date
                                    exit Start_Date_Loop;
                                end if;
                            end loop Start_Date_Loop;

                        -- get stop date
                        Stop_Date_Loop:
                            loop
                                -- until valid stop date
                                New_Line;
                                Put_Line (" What is this person's stop date? ");
                                Pr_Record.Stop_Dates (I) := Prompt_Pkg.Date;
                                -- check if valid stop date

                                if Pr_Record.Stop_Dates (I) = Null_Date then
                                    for J in I + 1 .. Dates_List'Last loop
                                        Pr_Record.Start_Dates (J) := Null_Date;
                                        Pr_Record.Stop_Dates (J) := Null_Date;
                                    end loop;

                                    exit Start_Stop_Dates_Loop;
                                elsif Pr_Record.Stop_Dates (I) <
                                      Pr_Record.Start_Dates (I) then
                                    Put_Line
                                       (" That is not a valid stop date.  The stop date must be ");
                                    Put_Line
                                       (" a later date than the start date.  TRY AGAIN!  ");
                                    Put (" The start date is ");
                                    Put (Pr_Record.Start_Dates (I).Month, 2);
                                    Put ('/');
                                    Put (Pr_Record.Start_Dates (I).Day, 2);
                                    Put ('/');
                                    Put (Pr_Record.Start_Dates (I).Year, 4);
                                    New_Line;
                                else
                                    -- non-null and valid stop date
                                    exit Stop_Date_Loop;
                                end if;
                            end loop Stop_Date_Loop;

                    else
                        -- don't want to add another start/stop date
                        exit Start_Stop_Dates_Loop;
                    end if;
                end if;  -- pressed <cr>
            end loop Start_Stop_Dates_Loop;
    end if;  -- not null date


    -- add the record to the linked list by calling the generic add
    Add (Pr_List, Pr_Record.Initials, Pr_Record);

    -- increment people counter
    New_Line;
    Num_Of_People := Num_Of_People + 1;

    New_Line;
    Put (" The number of people = ");
    Put (Num_Of_People, 2);
    New_Line (2);
    delay 1.0;
end Pr_Add;