views:

111

answers:

1

Hi guys.

I need an advice in problem with TFieldDef. I need to add one additional string property to the TFieldDef called Description. I want to see that property when I iterate over TFieldDefs collection. How to do this in Delphi 2007?

Thanks for your time.

+6  A: 

Mostly, you can't. But you can re-purpose another property such as DisplayName or Tag. You could also write a class helper, but you'd have to store the data elsewhere.

Craig Stuntz
DisplayName: not possible, it is not implemented in TFieldDefTag: I want String not an IntegerClass Helper: storing data elsewhere is not very convenient, not to mention I would have then free it explicitly? Thanks anyway Craig.
Wodzu
You can use strings with `Tag` if you reference a pointer or string list index. But you're going to have to come to grips with the fact that what you're asking is essentially unsupported. *Any* "solution" is going to be a bit hacky. And, yes, memory management is on you; there is no GC here.
Craig Stuntz
I've realized that after my comment. +1 Craig for made me to think ;-)
Wodzu