SHARE
TWEET

Unit Aerolineas

Nicolas_Ruiz Nov 14th, 2017 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. unit Aerolineas;
  2. interface
  3. uses crt;
  4. type
  5.     t_aerolinea=record
  6.                       cod:string[10];
  7.                       nombre:string[40];
  8.                       cuit:integer;
  9.                       domicilio:string[30];
  10.                       activo:boolean;
  11.                       end;
  12.     aerolinea= file of t_aerolinea;
  13.  
  14. var aer:aerolinea; reg:t_aerolinea; pos:integer;
  15.  
  16. procedure abrir (var aer:aerolinea);
  17. procedure leer (var aer:aerolinea; pos:integer; var reg:t_aerolinea);
  18. procedure guardar (var aer:aerolinea; reg:t_aerolinea);
  19. procedure modificar (var aer:aerolinea; pos:integer; reg:t_aerolinea);
  20.  
  21.  
  22. implementation
  23. procedure abrir (var aer:aerolinea);
  24. begin
  25.      assign ('Aerolineas.dat',aer);
  26.      reset (aer);
  27.      if ioresult <> 0 then
  28.         rewrite (aer);
  29. end;
  30.  
  31. procedure leer (var aer:aerolinea; pos:integer; var reg:t_aerolinea);
  32. begin
  33.      seek (aer,pos);
  34.      read (aer,reg);
  35. end;
  36. procedure guardar (var aer:aerolinea; reg:t_aerolinea);
  37. begin
  38.      seek (aer, filesize (aer));
  39.      write (aer,reg);
  40. end;
  41. procedure modificar (var aer:aerolinea; pos:integer; reg:t_aerolinea);
  42. begin
  43.      seek (aer,pos);
  44.      write (aer,reg);
  45. end;
  46. begin
  47.  
  48. end.
RAW Paste Data
Top