On Thursday, November 21, 2013 9:44 AM [GMT+1=CET],
D!s wrote:

>> One cause could be the file already opened or readonly.

> I'm sure the file isn't readonly. I suppose no one opens the file too,
> because I have one instance my program launched (and Delphi)

Well, as I wrote before setter TCustomEmulVT.SetLog() is buggy.
I'll resolve this quiz after nobody was able to find the bug
so far. Unit OverbyteIcsEmulVT.pas:

{code}
procedure TCustomEmulVT.SetLog(Value: Boolean);
begin
    if FLog = Value then
        Exit;
    if Value then begin
        AssignFile(FFileHandle, FLogFileName);   // angus V6.01
{$I-}
        Append(FFileHandle);
{$I+}
        if IOResult <> 0 then
            Rewrite(FFileHandle);
        Write(FFileHandle, '<Open>');
        FLog := Value;
    end
    else begin
        Write(FFileHandle, '<Close>');
        CloseFile(FFileHandle);
        FLog := Value;
    end;
end;
{code}

It will raise an exception if the attempt to open the file failed.
Anyway note that if you just add a log file name without path the current
directory is the destination which is different in the IDE to the one at 
run-time.  

-- 
Arno

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to