|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: B T
Length: 4438 (0x1156)
Types: TextFile
Names: »B«
└─⟦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⟧
separate (Tracker.Personnel_Pkg)
procedure Pr_Delete is
------------------------------------------------------------------------------
--|
--| NAME: PR_DELETE
--|
--| OVERVIEW:
--| This procedure is used to delete a record from the list by calling
--| the List_Pkg procedure delete. When a person is deleted from the
--| personnel list, his initials also have to be changed in every
--| element to which he belonged in the element list by calling the
--| procedure CHANGE_PR_IN_EL.
--|
--| EXCEPTIONS HANDLED:
--| none
--|
--| HISTORY:
--| written by May Lee March 1985
--|
--| NOTES:
--| The number of people is decremented after the record is deleted.
--|
--| A check is made to insure that the last person is not deleted. There
--| must be at least one person at all times.
--|
-----------------------------------------------------------------------------
Abort_Proc : Boolean; -- abort getting an existing pr
End_List : Boolean := False;
El_Record : Element_Pointer;
Ele_Ptr : Element_Pointer;
Found : Boolean; -- parameter to find
Key : Pr_Init_Type; -- initials of the person looking for
New_Initials : Pr_Init_Type; -- replacement pr
Pr_Record : Personnel_Pointer; -- person record
New_Pr_Record : Personnel_Pointer; -- new person's record
Successful : Boolean := False; -- if key found in list
begin
if Num_Of_People > 1 then
-- have to have at least one person
Put_Line ("Which person would you like to delete? ");
-- get the person's initials
Prompt_Pkg.Existing_Person_Initials (Abort_Proc, Key);
if not Abort_Proc then
--point to that record in the list
Find (Pr_List, Key, Pr_Record, Found);
-- delete the person from the list
Delete (Pr_List, Key, Successful);
-- check to see if person belonged to an element
Start_Walk (Pr_Record.Element_List);
Walk (Pr_Record.Element_List, Ele_Ptr, End_List);
if not End_List then
-- change person's initials in element data
Put (" When person ");
Put (Pr_Record.Initials);
Put (" is deleted, ");
New_Line;
Put_Line
(" who would you like to use in his place in the element data? ");
-- prompt for new number
loop
Prompt_Pkg.Existing_Person_Initials
(Abort_Proc, New_Initials);
exit when not Abort_Proc;
Put_Line (" You cannot abort the procedure at this time. ");
Put_Line (" You must enter valid initials. ");
end loop;
Find (Pr_List, New_Initials, New_Pr_Record, Found);
-- change the person's initials in the element data
Change_Pr_In_El (Pr_Record, New_Initials);
-- move these elements to the new person's element list
Start_Walk (Pr_Record.Element_List);
loop
Walk (Pr_Record.Element_List, Ele_Ptr, End_List);
exit when End_List;
-- add the element to the person's list only if it isn't already
-- in the person's element list. This could happen if the element
-- was assigned to several people.
Find (New_Pr_Record.Element_List,
Ele_Ptr.Desc_Key, El_Record, Found);
if not Found then
Add (New_Pr_Record.Element_List,
Ele_Ptr.Desc_Key, Ele_Ptr);
end if;
end loop;
end if;
-- decrement the person counter
Num_Of_People := Num_Of_People - 1;
New_Line;
Put (" The number of people = ");
Put (Num_Of_People, 1);
New_Line (2);
delay 1.0;
end if; -- not abort
else
Put_Line (" You must have at least one person at all times. ");
Put_Line (" Since you only have one person at this time, you ");
Put_Line (" cannot delete. ");
delay 2.0;
end if;
end Pr_Delete;