Записи для работы с комбинациями разных типов в Pascal, страница 6

         ClrScr;

         Write(MenuItems[a+1]);

         Window(1,25,80,25);

         TextBackground(Blue);

         ClrScr;

         Write(ItemDescription[SelectedItem]);

         End;

   End;

   Function GetMenuResult(Var SelectedItem:Integer):Integer;

   { *********************************************************

     Function provides Handling of KeyPress Events and returns

     the Number of Item selected by User

     ********************************************************* }

      Var KeyCode:Integer;

   Begin

      Repeat

         Repeat KeyCode:=Ord(ReadKey) Until KeyCode<>0;

         Case KeyCode of

            72: If SelectedItem=1 Then SelectedItem:=ItemsNumber Else SelectedItem:=SelectedItem-1;

            80: If SelectedItem=ItemsNumber Then SelectedItem:=1 Else SelectedItem:=SelectedItem+1;

            13: GetMenuResult:=SelectedItem;

         End;

         ShowMenu(SelectedItem);

      Until KeyCode=13;

   End;

   Var CurrentItem,MenuResult:Integer;

{ ******************************************

  *************    End Menu    *************

  ****************************************** }

   Type

      tFriend=Record

         Name:String[10];

         FamilyName:String[15];

         TelephoneNumber:String[15];

         Address:String[40];

      End;

      tDataBase=Array[1..180] of tFriend;

   Procedure Enter_Record(Var Destination:tFriend);

   { ********************************************

     Procedure shows the Dialog used to enter the

     Information about the Person

     ********************************************}

   Begin

      Write ('Enter Name: ');

      ReadLn (Destination.Name);

      Write ('Enter Family Name: ');

      ReadLn (Destination.FamilyName);

      Write ('Enter Telephone Number: ');

      ReadLn (Destination.TelephoneNumber);

      Write ('Enter Address: ');

      ReadLn (Destination.Address);

   End;