Advertisement
AIwinter

лабабд

Oct 2nd, 2022
1,031
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 1.00 KB | None | 0 0
  1. Uses Crt;
  2.  
  3. type
  4.   Actors = Record
  5.     ID_F: word;
  6.     Name_A: string[18];
  7.     Fam_A: string[18];
  8.     DofB: string[8];
  9.     Roles: byte;
  10.     Gender: boolean;
  11.   end;
  12.  
  13.   Films = Record
  14.     ID_F: word;
  15.     ID_A: word;
  16.     Name_F: string[20];
  17.     Adress: string[20];
  18.     Duration: string[6];
  19.     Date: string[8];
  20.   end;
  21.  
  22. var
  23.   FV1: file of Actors;
  24.   ActorsBP: Actors;
  25.  
  26.   FV2: file of Films;
  27.   FilmsBP: Films;
  28.  
  29. const
  30.   ActorsName = 'Actors.owo';
  31.   FilmsName = 'Films.owo';
  32.  
  33. procedure Open;
  34. begin
  35.   Assign(FV1, 'Actors.owo');
  36.   Assign(FV2, 'Films.owo');
  37.  
  38.   if not FileExists(ActorsName) then ReWrite(FV1)
  39.   else ReSet(FV1);
  40.  
  41.   if not FileExists(FilmsName) then ReWrite(FV2)
  42.   else ReSet(FV2);
  43. end;
  44.  
  45. procedure Close;
  46. begin
  47.   Close(FV1);
  48.   Close(FV2);
  49. end;
  50.  
  51. procedure Menu;
  52. var
  53.   input: string;
  54. begin
  55.   Write('Введите 1 чтобы выйти: ');
  56.   ReadLn(input);
  57.   case input of
  58.     '1': Close;
  59.   end;
  60.  
  61. end;
  62.  
  63. begin
  64.   Open;
  65.   Menu;
  66.   Close;
  67. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement