{
 $Id$
}

{quickbbs 2.76}

Procedure Bbs2;
Type
  SecurityRecord = Record
    Security : Word;
    Flags    : Array[1..4] of byte;
  End;

  FileAreaRecord = Record (* FILECFG.DAT *)
    AreaName,
    FilePath,
    ListPath    : String[66];
    AllowUploads,
    IgnoreKlimit,
    IgnoreRatio : Boolean;
    DlSec       : SecurityRecord;
    SearchSec   : SecurityRecord;
    TemplateSec : SecurityRecord;
    CheckDupes  : Boolean;
    Group       : Byte;
    Spare       : Array[3..12] of Byte;
  End;
Var
  FFile : File of FileAreaRecord;
  F     : FileAreaRecord;
  Tel   : Word;
Begin
  Writeln('Converting QuickBBS 2.76 file areas.',#10#13);

  Assign(Ffile, BbsPath + 'FILECFG.DAT');
  {$I-} Reset(Ffile); {$I+}
  If ioresult <> 0 then
    Begin
      Writeln('Cannot find '+bbspath+'FILECFG.DAT!');
      Halt;
    End;

  AddToFile(false);

  Tel := 0;
  While not eof(ffile) do
    Begin
      {$I-} Read(Ffile,F); {$I+}
      If ioresult <> 0 then
        Begin
          Writeln('Error reading '+bbspath+'FILECFG.DAT!');
          Halt;
        End;

      Inc(Tel);
      If F.areaname <> '' then
        Begin
          Inc(Number);
          Bbs.on   := False;
          Bbs.name := F.AreaName;
          Bbs.nr   := Tel;
          Bbs.path := F.FilePath;
          AddToFile(saveset);
        End;
    End;
  Close(Ffile);
End;
