All pastes #822620 Raw Edit

Someone

public text v1 · immutable
·published 2007-12-18 21:00 UTC
rendered paste body
Function FileExists (Name : String) : boolean;

Var F : File;

begin
  {$i-}
  Assign (F,Name);
  Reset (F);
  {$I+}
  FileExists:=(IoResult=0) and (Name<>'');
  Close (f);
end; { FileExists }

procedure parse_fichier(f : string);

var
   ft	 : text;
   st	 : string;
   s1,s2 : string;
   i,j	 : integer;
   c	 : char;
   a	 : arbre;

begin
   if not(FileExists(f)) then
   begin
      writeln('le fichier ', f, ' n''existe pas');
      exit;
   end;
   assign(ft,f);
   reset(ft);
   a := creer_arbre_vide();
   while not(eof(ft)) do
   begin
      readln(ft,st);
      s1 := copy(st,1,pos(' ',st)-1);
      s2 := copy(st,pos(' ',st)+1,length(st)-pos(st,' '));
      val(s1,i);
      val(s2,j);
      writeln('>>',i,' ',j);
      inserer_point(creer_point(i,j),a);
   end;
end; { parse_fichier }