(* Stats for wfc. Never Finished *)
unit stats;
interface
procedure updatestats;
implementation
uses dos,crt,io,records,genstr,filehandle;

procedure incstat(which:byte;s:string);
begin
case which of
  1:stat. Today_Post  :=valu(s);
  2:stat. Today_Ups   :=valu(s);
  3:stat. Today_Dwns  :=valu(s);
  4:stat. Today_Calls :=valu(s);
  5:stat. Today_Email :=valu(s);
  6:stat. Today_Feed  :=valu(s);
  7:stat. Today_Time  :=valu(s);
  8:stat. Last_Alias  :=s;

  9 :stat. Last_Posts  :=valu(s);
  10:stat. Last_Ups    :=valu(s);
  11:stat. Last_Downs  :=valu(s);
  12:stat. Last_Feed   :=valu(s);
  13:stat. Last_Credits:=valu(s);
  14:stat. Last_Note   :=s;

  15:stat. Total_Calls :=valu(s);
  16:stat. Total_Ups   :=valu(s);
  17:stat. Total_Downs :=valu(s);
  18:stat. Total_Email :=valu(s);
  19:stat. Total_Mesgs :=valu(s);
  20:stat. Total_Files :=valu(s);
  21:stat. Total_Users :=valu(s);
  end;
end;

procedure readstats;
var F:FILE;

begin
if nassign(f,Config.Data_Dir+'STAT.DAT')=false
then
begin
nread(f,stat,sizeof(stat));
nreset(F);
end;

nwrite(f,stat,sizeof(stat));
nclose(F);
end;

procedure updatestats;
var F:FILE;

begin
nassign(f,Config.Data_Dir+'STAT.DAT');
nwrite(f,stat,sizeof(stat));
nclose(F);
end;


begin

end.

   StatRec = Record
              Today_Post  : Word;
              Today_Ups   : Word;
              Today_Dwns  : Word;
              Today_Calls : Word;
              Today_Email : Word;
              Today_Feed  : Word;
              Today_Time  : LongInt;

              Last_Alias  : String[30];
              Last_Posts  : Byte;
              Last_Ups    : Byte;
              Last_Downs  : Byte;
              Last_Feed   : Byte;
              Last_Credits: LongInt;
              Last_Note   : String[50];

              Total_Calls : Word;
              Total_Ups   : Word;
              Total_Downs : Word;
              Total_Email : Word;
              Total_Mesgs : Word;
              Total_Files : Word;
              Total_Users : Word;
             End;
