Advertisement
M1RAI

file_test(not working)

Oct 6th, 2019
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.57 KB | None | 0 0
  1.  program location_voiture;
  2.  uses wincrt;
  3.  type
  4.  voit=record
  5.  mat:string[11];
  6.  age:byte;
  7.  puiss:string;
  8.  disp:Boolean;
  9.  end;
  10.  fiche=file of voit;
  11.  var
  12.  v:voit;
  13.  N:word;
  14.  f:file;
  15.  
  16.  procedure sasie( var n:word);
  17.  begin
  18.     Repeat
  19.         write('n=');
  20.         readln(n);
  21.     until n>=2
  22. end;
  23.  
  24. procedure remp (var f:file ;Var v:voit);
  25. begin
  26.     assign(f,'C:\Travail Pascal\Agence Location voiture\location_voiture.dat');
  27.     ReWrite(f);
  28.     write('matricule=');
  29.     read(v.mat);
  30.     write(f,v);
  31.     close(f);
  32. end;
  33.  
  34. Begin
  35. saisie(n);
  36. remp(f,n);
  37. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement