Show quoted text 17 lines
Let me explain why I asked. I have added Else part with some testing
code. It looks like this:
if not HandleAllocated then
begin
...
if not HandleAllocated then
CreateHandle
else begin // TESTING CODE HERE
assignfile(f,'debug.txt'); // f is declared as textfile
rewrite(f);
writeln(f,'Handle is allocated');
closefile(f);
end;
end;
Then I compiled and ran Lazarus but the file debug.txt was never
created. So hence I think the second condition �If not HandleAllocated�
is useless (always true).
Most handles are created, because the form starts creating them. When a new form has not yet created its handle and one of its components needs its handle, the above case will happen.
Show quoted text 15 lines
But if the handle can be really created in the
recursion then leave this line as it is (I'm not LCL wizard).
Don't blame me I'm so punctilious, I know that the cleanups aren't
priority nowadays and I don't want raise a quarrel about one line of
code but I have another simple question.
In constructor TcustomForm.CreateNew is following code:
...
BeginFormUpdate;
FBorderStyle:= bsSizeable;
inherited Create(AOwner);
... // 15 lines here
FBorderStyle := bsSizeable;
...
Why is there �FborderStyle := bsSizeable� twotimes?
Has it any hidden mysterious sense which I can't see?
Lack of time. ;)
I deleted the second one.
Mattias