Hello RAW,
why do you continue to argue, after the decision has fallen? Can't you accept / respect this?
Where is a real difference between
if FormMM <> nil then FormMM.MM.Lines.Add(...);
and
if memoopen then FormMM.MM.Lines.Add(...);
I don't see one.
Easy: the second way needs 2 global variables and the first way only one, so the first way is less complex and easier and safer ... !!!
The difference is
one variable, which needs 1 byte of memory, in a program of 10 or 20 MB or more. In my eyes this is
nothing. I would not talk of "more complexity" because of something like this.
Also the boolean "memoopen" needs to be set to false or true exactly as the NIL-way and so that's a bad design!
But the
big difference is:
- memoopen is set
automatically inside the class and it is absolute
easy to do this
- setting FormMM to nil requires a
huge effort and
additional it increases the complexity and reduces the flexibility, how this common class could be used everywhere.
For this reasons, I prefer the "design" of my old class.
Obviously we have different opinions about what counts more in the question, what -
in sum - is a "better" design or not. This should not be a problem... Fortunately it's my job to decide, which solution I'll use.
by the way: the demo program is working very fine if you choose to delete "CloseAction:=caFree;" or "FreeAndNil(FormMM);"!!!
The whole thing is all about destroying a form that is already destroyed...
Did you read nothing of this Topic?
1) Why "CloseAction:=caFree" is
neccessary was written multiple times!
2) And many people have already written
uncountable times that to delete FreeAndNil(FormMM) is a
solution! Why dou you repeat things, that we all know for long?
I don't want to continue this discussion, it makes no sense.