{$IFNDEF OS2}
{$M $4000,0,0}
{$ENDIF}

Uses
  DOS,
  tMisc;

Var
  F, F1                         : Text;
  Strr, Section                 : String;
  i                             : Byte;

Begin
  {OUTGOING CTL MODIFY}

  For i := 0 To 1 Do
  Begin
    Assign (F,  '\work\out\tornado.ct' + Long2Str (i));
    Assign (F1, '\torctl.$$$');

    ReSet (F);
    ReWrite (F1);

    While Not EoF (F) Do
    Begin
      ReadLn (F, Strr);
      If Copy (Trim (Strr), 1, 1) = '[' Then Section := UpString (ExtractWord (1, Strr, ['[', ']', ' ']));

      If Section = 'SYSTEM' Then
      Begin
        If UpString (ExtractWord (1, Strr, [' '])) = 'SYSOP' Then ChangeParam (Strr, 'Beta Tester');
        If UpString (ExtractWord (1, Strr, [' '])) = 'BBSNAME' Then ChangeParam (Strr, 'Beta Testing BBS');
        If UpString (ExtractWord (1, Strr, [' '])) = 'LOCATION' Then ChangeParam (Strr, 'Beta Testing Area');
        If UpString (ExtractWord (1, Strr, [' '])) = 'PATH' Then ChangeParam (Strr, 'C:\TORNADO');
      End Else
      If Section = 'MISCELLANEOUS' Then
      Begin
        If UpString (ExtractWord (1, Strr, [' '])) = 'LOGEVENTS' Then ChangeParam (Strr, '~:!+*');
        If UpString (ExtractWord (1, Strr, [' '])) = 'FAST_LOGON' Then ChangeParam (Strr, 'No');
      End Else
      If Section = 'MODEM' Then
      Begin
        If UpString (ExtractWord (1, Strr, [' '])) = 'PORT' Then ChangeParam (Strr, '2');
        If UpString (ExtractWord (1, Strr, [' '])) = 'BAUDRATE' Then ChangeParam (Strr, '19200');
        If UpString (ExtractWord (1, Strr, [' '])) = 'INITSTRING' Then ChangeParam (Strr, 'ATZ|');
        If UpString (ExtractWord (1, Strr, [' '])) = 'ANSWERSTRING' Then ChangeParam (Strr, 'ATA|');
      End Else
      If Section = 'FILE&DIRS' Then
      Begin
        If UpString (ExtractWord (1, Strr, [' '])) = 'TEMPDIR' Then ChangeParam (Strr, 'C:\');
        If UpString (ExtractWord (1, Strr, [' '])) = 'FLAGSDIR' Then ChangeParam (Strr, 'C:\');
        If UpString (ExtractWord (1, Strr, [' '])) = 'DOORINFODIR' Then ChangeParam (Strr, 'C:\');
      End;

      WriteLn (F1, Strr);
    End;

    Close (F);  Erase (F);
    Close (F1); Rename (F1, '\work\out\tornado.ct' + Long2Str (i));
  End;

  {MODIFYING TORNADO.CTL ON MY STATION}
(*
  Assign (F,  'D:\FIDO\TORNADO\tornado.ctl');
  Assign (F1, 'D:\torctl.$$$');

  ReSet (F);
  ReWrite (F1);

  While Not EoF (F) Do
  Begin
    ReadLn (F, Strr);
    If Copy (Trim (Strr), 1, 1) = '[' Then Section := UpString (ExtractWord (1, Strr, ['[', ']', ' ']));

    If Section = 'SYSTEM' Then
    Begin
      If UpString (ExtractWord (1, Strr, [' '])) = 'SYSOP' Then ChangeParam (Strr, 'Konstantin Klyagin');
      If UpString (ExtractWord (1, Strr, [' '])) = 'BBSNAME' Then ChangeParam (Strr, 'Pulse BBS');
      If UpString (ExtractWord (1, Strr, [' '])) = 'LOCATION' Then ChangeParam (Strr, 'Kharkov, Ukraine');
      If UpString (ExtractWord (1, Strr, [' '])) = 'PATH' Then ChangeParam (Strr, 'D:\FIDO\TORNADO');
    End Else
    If Section = 'FILE&DIRS' Then
    Begin
      If UpString (ExtractWord (1, Strr, [' '])) = 'TEMPDIR' Then ChangeParam (Strr, 'C:\TMP');
      If UpString (ExtractWord (1, Strr, [' '])) = 'LOGFILE' Then ChangeParam (Strr, 'E:\FIDO\LOG\tornado.log');
    End Else
    If Section = 'MISCELLANEOUS' Then
    Begin
      If UpString (ExtractWord (1, Strr, [' '])) = 'SOUND' Then ChangeParam (Strr, 'No');
      If UpString (ExtractWord (1, Strr, [' '])) = 'LOGEVENTS' Then ChangeParam (Strr, '~:!+*&');
    End;

    WriteLn (F1, Strr);
  End;

  Close (F);  Erase (F);
  Close (F1);

  Rename (F1, 'D:\FIDO\TORNADO\tornado.ctl');
  {END}
*)
End.