TidLogFile.Active

Giganews Newsgroups
Subject: TidLogFile.Active
Posted by:  Tim Parker-Nance (tim_…@hotmail.com)
Date: Thu, 28 Jul 2005

Got a weird one here, seems like you can never set the Active to True on a
LogFile. I am using the latest snapshot from 28/07/205 for Indy 10 in Delphi
2005. To reproduce it do the following:

1) Create a new Delphi 2005 Win32 application.
2) Add a TidLogFile component.
3) Set the FileName to Test.txt.
4) Set Active to true.
5) Add a button.
6) In the OnClick set idLogFile1.Active := True

You will see the active never gets set to true. You can also debug the
button event and you will see that the TidLogBase.SetActive code is as
follows:

procedure TIdLogBase.SetActive(AValue: Boolean);
begin
  if IsLoading then
    FStreamedActive := AValue
  else
    if FActive <> AValue then
    begin
      FActive := AValue;
      if FActive then
        Open
      else
        Close;
    end;
end;

The problem is that IsLoading always returns True, even after the form has
loaded.

Any ideas how to get around this one?

Tim

Replies