[fpc-pascal] flexible record design

spir ☣ denis.spir at gmail.com
Fri May 28 14:01:04 CEST 2010

On Fri, 28 May 2010 12:25:59 +0200
Felipe Monteiro de Carvalho <felipemonteiro.carvalho at gmail.com> wrote:

> > I would like to know the underlying structure of TString (linked list, "flexible-ised" dynamic array, what else?).  
> TStrings provides no storage.
> I think that TStringList should be what you are looking for. See it's
> code instead.

I know about TStringList. But it does not provide associated values & objects. The reason why I ask about what these things are (supposed to be) in the interface of TStrings.
I have a better idea about values, now. Seem to be strings as well (the name "value" is a bit misleading imo), so not what I need at all. 
But I'm still digging to try and find out what object association is *intended* to be, its purpose and possible implementation. In other word, what's the actual aim of this virtual interface?

The doc reads:
"Indexed access to the objects associated with the strings in the list.
Objects provides indexed access to the objects associated to the strings in the list. Index is a zero-based index and must be in the range of 0 to Count-1.
Setting the objects property will not free the previously associated object, if there was one. The caller is repsonsible for freeing the object that was previously associated to the string.
TStrings does not implement any storage for objects. Reading the Objects property will always return Nil, Setting the property will have no effect. It is the responsability of the descendent classes to provide storage for the associated objects."

This is not stupid enough for me. I don't know what to do with this.


vit esse estrany ☣


More information about the fpc-pascal mailing list