Yesterday I have ask a question, and I received a very good solution
from rllibby, I thought that was the solution of my problem. But later
on I have discovered another problem.
This is the code that belongs to the checkbox:
if DebLog.Checked then
deb := True
else Deb := False;
This is the procedure that initiates the logging:
procedure Log(str: string);
if not FileExists('c:\log.txt') then
Writeln(F, DateTimeToStr(Now) + ': ' + str);
And this is the code that writes the line to the logging:
if deb then
* If the user has checked the checkbox I want all messages being written to a log
and certain messages have to be written to a log but als display a ShowMessage.
* if the user has unchecked the checkbox no messages will be written to a log
but the messages that displays ShowMessage, have to be displayed.