Why 1.99 suddenly no longer equals 1.99

A strange problem suddenly occurs in all my Delphi 7 and Delphi 2009 unit tests. I used DUnit CheckEquals to compare two Currency values, like [sourcecode language="pascal"] CheckEquals(1.99, SomeCurrencyValue) [/sourcecode] This worked fine in the IDE and in our build scripts, which run using the same version of DUnit for two years. Now, all of … Continue reading Why 1.99 suddenly no longer equals 1.99

Why is “Self” assignable in Delphi?

This code in a GUI application compiles and runs (tested with Delphi 6 and 2009): procedure TForm1.Button1Click(Sender: TObject); begin Self := TForm1.Create(Owner); end; Questions that come to mind: why is Self writeable and not read-only? in which situations could this be useful? If you know the answer, I would be happy if you post it … Continue reading Why is “Self” assignable in Delphi?