Sometimes you are at clients that don’t fully appreciate the luxury of keeping their development environment current.
This case a client still using Delphi 2006, where I promptly ran into a compiler error that was solved 5 years ago: a “F2084 Internal Error: C11919” at the end of the method.
begin if RMQResult.Create(CompCode, Reason).IsOK then //... end; // [Pascal Fatal Error] MQObjects.pas(668): F2084 Internal Error: C11919
The cause is that the compiler barfs at calling a method on a freshly created record.
The function result is an intermediate, which is not handled correctly (fixed in Delphi 2007).
This is not only for record intermediates: reusing an intermediate like the result of Pred() will crash the compiler in Delphi 2006.
The workaround is introducing a real variable.
This works:
var MQResult: RMQResult; begin MQResult := RMQResult.Create(CompCode, Reason); if MQResult.IsOK then //... end; // compiles fine
–jeroen