Use of object within a record declaration
Posted on 2009-04-15
I have been looking at a third party's code and have found an occurence of a user-defined class declaration (RecData in the example) within a record !?
TMyRecord = record
TMyRecType =(rtTypeOne, rtTypeTwo, etTypeThree);
...where TMyObject has its own constructors/destructors/properties/methods etc
I am quite sure this is bad practice, as I have never exercised this approach before. However the occurence of this record is quite prevalent in the existing code and I do not fully understand the impact of having such a scenario -- though I suspect it is contributing to some memory loss (not picked up by 3rd party tools) over time.
Has anyone come across this before?