Forum > Beginners

Get class fields names and assign to record fields

<< < (2/2)

jamie:
from what I can tell in your post, you are looking for the use of TCollection that manages
a TCollectionItem.

 TCollectionItem has an ID, DisplayName and a few other things in it.

you base your classes from a TCollectionItem

So with that,

 Type
    TMyClass = Class(TCollectionItem)
       your added stuff,
  End;

 And the collection.
TMyCollection := TCollection.Create(TMyClass);

 From there, as you create new items you can add them to the list..

TMyCollection.Add....

 It may not be exactly what you want but I bet it's close.

 The classes can be found in the LCL help file and online.

Navigation

[0] Message Index

[*] Previous page

Go to full version