diff --git a/src/CALCULS3.PAS b/src/CALCULS3.PAS
index bcdd85d300706ebe44c799dfb7396ab486e02757..7ba092b338b826eb78783c5a2ca23121db86bdf6 100644
--- a/src/CALCULS3.PAS
+++ b/src/CALCULS3.PAS
@@ -753,7 +753,6 @@ procedure C3_CalculChroniquesVolume;
   Ici_EcritureEnteteDefaillances(1);
   for Xi:=0 to 2 do
    begin
-    YNbQXdefNul[Xi,1]:=0;
     YQXdefmoyGlop[Xi,1]:=0;
     assign(YFicQXdef[Xi,1],YRepT+YNomFicQXdef[1]+YExt[Xi]);
     rewrite(YFicQXdef[Xi,1]);
@@ -817,10 +816,8 @@ procedure C3_CalculChroniquesVolume;
     {--… jour de YQXdefmoy glop pour type Xi de d‚faillance de 0 … 2--}
     for Xi:=0 to 2 do
      begin
-      if YQXdef[Xi]<=YTouComNul then
-       YNbQXdefNul[Xi,1]:=YNbQXdefNul[Xi,1]+1
-      else
-       YQXdefmoyGlop[Xi,1]:=YQXdefmoyGlop[Xi,1]+exp(YPuiss*ln(YQXdef[Xi]));
+      if YQXdef[Xi]>YTouComNul then
+        YQXdefmoyGlop[Xi,1]:=YQXdefmoyGlop[Xi,1]+exp(YPuiss*ln(YQXdef[Xi]));
       write(YFicQXdef[Xi,1],YQXdef[Xi]);
      end;
     writeln(YFicResult4,B_Date(Yi),'   ',YQXdef[0]:23:3,' ',YQXdef[2]:23:3,' ',YQXdef[1]:23:3);
@@ -955,7 +952,6 @@ procedure C3_CalculChroniquesVolume;
   Ici_EcritureEnteteDefaillances(2);
   for Xi:=0 to 2 do
    begin
-    YNbQXdefNul[Xi,2]:=0;
     YQXdefmoyGlop[Xi,2]:=0;
     assign(YFicQXdef[Xi,2],YRepT+YNomFicQXdef[2]+YExt[Xi]);
     rewrite(YFicQXdef[Xi,2]);
@@ -1024,10 +1020,8 @@ procedure C3_CalculChroniquesVolume;
     {--… jour de YQXdefmoy glop pour type Xi de d‚faillance de 0 … 2--}
     for Xi:=0 to 2 do
      begin
-      if YQXdef[Xi]<=YTouComNul then
-       YNbQXdefNul[Xi,2]:=YNbQXdefNul[Xi,2]+1
-      else
-       YQXdefmoyGlop[Xi,2]:=YQXdefmoyGlop[Xi,2]+exp(YPuiss*ln(YQXdef[Xi]));
+      if YQXdef[Xi]>YTouComNul then
+        YQXdefmoyGlop[Xi,2]:=YQXdefmoyGlop[Xi,2]+exp(YPuiss*ln(YQXdef[Xi]));
       write(YFicQXdef[Xi,2],YQXdef[Xi]);
      end;
     writeln(YFicResult4,B_Date(Yi),'   ',YQXdef[0]:23:3,' ',YQXdef[2]:23:3,' ',YQXdef[1]:23:3);
diff --git a/src/CALCULS4.PAS b/src/CALCULS4.PAS
index 690783720ec014ef54f9a0cf177be6f3817acdc6..c0eb9cee516e03f3a2448f00851dfad3afea04fd 100644
--- a/src/CALCULS4.PAS
+++ b/src/CALCULS4.PAS
@@ -4,7 +4,7 @@ interface
  uses Utilit,DECLARA;
 
 
-procedure C4_TriChronique(var ZFic,ZFicT:YtypFod; ZNbNul : longint; ZTouComNul : double;
+procedure C4_TriChronique(var ZFic,ZFicT:YtypFod; ZTouComNul : double;
                        var ZQmoy,ZQmed,ZQmax,ZQmin : double; var ZQRare,ZQfrequent : YtypFreq);
 
 IMPLEMENTATION
@@ -16,14 +16,10 @@ IMPLEMENTATION
 {--pr‚d‚finies ainsi que min, max, m‚diane et moyenne                 --}
 {=======================================================================}
 
-procedure C4_TriChronique(var ZFic,ZFicT:YtypFod; ZNbNul : longint; ZTouComNul : double;
+procedure C4_TriChronique(var ZFic,ZFicT:YtypFod; ZTouComNul : double;
                        var ZQmoy,ZQmed,ZQmax,ZQmin : double; var ZQRare,ZQfrequent : YtypFreq);
- const
-  XNomFicTri   : string = 'TRI';
-  XNul         : double = 0;
 
  var
-  XFic         : YTypFod;
   XRang        : longint;
   Xeffectif    : longint;
   XQ           : double;
@@ -61,8 +57,6 @@ procedure C4_TriChronique(var ZFic,ZFicT:YtypFod; ZNbNul : longint; ZTouComNul :
   until eof(ZFic);
   close(ZFic);
   seek(ZFicT,filesize(ZFicT));
-  for XRang:=1 to ZNbNul do
-   write(ZFicT,XNul);
   reset(ZFicT);
   read(ZFicT,ZQmax);
   XEffectif:=filesize(ZFicT);
diff --git a/src/DECLARA.PAS b/src/DECLARA.PAS
index 76ab027fb9221c90f1318c2128780a88ad299f9c..f523ff8d7a125d2167d2356f46b2367da289a546 100644
--- a/src/DECLARA.PAS
+++ b/src/DECLARA.PAS
@@ -295,7 +295,6 @@ VAR {tableaux d'entiers}
  YRangStatAv   : YTabInt1; {rang de station aval dans fichier des d‚bits de base}
  YRangStatInt  : YTabInt1; {rang de station interm‚diaire dans fichier des d‚bits de base}
 
- YNbQXdefNul    : array[0..2,1..2] of longint; {nombre d'‚checs nuls,pour QXdef0, QXdef1 ou QXdef2, et pour sens inverse chrono ou sens chrono}
  YNCodeAval    : array[1..YNmaxLacs,-2..2] of longint;
  YNCodePrise   : array[1..YNmaxLacs,-4..3] of longint;
  YNcodeRepart  : array[1..YNmaxLacs,-2..3] of longint;
diff --git a/src/VGEST.PAS b/src/VGEST.PAS
index fe8be2a0848d887772ff58738a4b0e1c0324e3c6..9d9351636f89dd848f7ca7b7f7ca3bacec4d2fea 100644
--- a/src/VGEST.PAS
+++ b/src/VGEST.PAS
@@ -245,10 +245,14 @@ procedure Ici_Effacement;
 
  procedure Ici_EditionBilan;
 
+  const
+    XNul : double = 0;
+
   var
    Xi : integer;
    Xj : integer;
    XQXdef : array[1..2,1..2] of double;
+   nbEof : integer;
 
   begin
 
@@ -387,7 +391,7 @@ procedure Ici_Effacement;
        begin
         assign(YFicQXdef [Xi,Xj],YRepT+YNomFicQXdef [Xj]+YExt[Xi]);
         assign(YFicQXdefT[Xi,Xj],YRepT+YNomFicQXdefT[Xj]+YExt[Xi]);
-        C4_TriChronique(YFicQXdef[Xi,Xj],YFicQXdefT[Xi,Xj],YNbQXdefNul[Xi,Xj],YTouComNul,YQXdefmoy[Xi,Xj],YQXdefmed[Xi,Xj],YQXdefmax[Xi,Xj],YQXdefmin[Xi,Xj],YQXdefrare[Xi,Xj],YQXdeffrequent[Xi,Xj]);
+        C4_TriChronique(YFicQXdef[Xi,Xj],YFicQXdefT[Xi,Xj],YTouComNul,YQXdefmoy[Xi,Xj],YQXdefmed[Xi,Xj],YQXdefmax[Xi,Xj],YQXdefmin[Xi,Xj],YQXdefrare[Xi,Xj],YQXdeffrequent[Xi,Xj]);
        end;
      writeln(YFicResult4);
      writeln(YFicResult4,'Fonctions de repartition (frequence = (n-YA)/(Effectif+YB) avec n=rang, YA=',YA,' et YB=',YB,') :');
@@ -430,12 +434,21 @@ procedure Ici_Effacement;
        reset(YFicQXdefT[Xi,Xj]);
      writeln(YFicResult4,'                  QXdef1                  QXdef1                  QXdef2                  QXdef2');
      writeln(YFicResult4,'   (chronologie inverse)    (sens chronologique)   (chronologie inverse)    (sens chronologique)');
-     while not eof(YFicQXdefT[1,1]) do
+     nbEof:=0;
+     while nbEof < 4 do
       begin
+       nbEof:=0;
        for Xi:=1 to 2 do
         for Xj:=1 to 2 do
          begin
-          read(YFicQXdefT[Xi,Xj],XQXdef[Xi,Xj]);
+          if not eof(YFicQXdefT[Xi,Xj]) Then
+            read(YFicQXdefT[Xi,Xj],XQXdef[Xi,Xj])
+          else
+            begin
+              XQXdef[Xi,Xj]:=XNul;
+              nbEof:=nbEof+1;
+            end;
+
           write(YFicResult4,'  ',XQXdef[Xi,Xj]:22);
          end;
        writeln(YFicResult4);