TContainer component should be used to store data in memory, and provides access to disk files - ASCII texts and binary streams. TContainer allocates internal TList object to keep pointers to data elements array. Data elements are descendants of abstract TData class. Currently 3 useful data classes are predefined in Data.pas unit: TFunction, TRealData and TStringData. TContainer (and other components) is polymorphic: it may contain any TData descendant class and even items of different classes simultaneously.
See also IDMContainer interface for additional information.
Keeps pointers to data elements. You should use TContainer.Clear() method instead of TList.Clear() to deallocate items data. Use other TList methods and properties to access, add or delete elements. Use InitItem method to create data elements and Free procedure to destroy them.
This property used to track data modifications. When you change this property (directly or indirectly), OnChanged event is fired.
This property affect on class type of data elements created by InitItem method. You may use your own data classes derived from standard ones.
This method used to display progress of time-consuming operations like disk access or bulk data modification. Note that this method may be called by TWorksheet component. By default it fires OnProgress event.
Creates data element. Uses OnInitItem event handler or DataClass property.
Clear Items object and free all data elements. In addition, set Modified property to true. Use this method instead of TList's one.
Text file support routines. Text-type file must contain values separated by commas, tabstops or spaces. Decimal point character always assumed to be point (.). Both use FileName property, Modified property automatically cleared. If Backup=true, backup copy will be created. Unlike other methods, LoadFromFile() display progress as number of lines.
Stream support routines. Also clear Modified property. DataType remembered in the stream, InitItem used to create data elements.
Sorts selected items range (from BegLine to EndLine) with fast recursive QuickSort algorithm. Descend parameter defines sort order.
Standard VCL method allows you to copy data from another container or TStrings object. Modified property set to true.
This method performs table calibration. Works only with TRealData items. Index is position of returned value, Key used to seek between data items.
Disk file name hold by container. If AutoLoad property is true, file will be automatically loaded when you assign value to this property.
Allows you to set the type of data elements at design-time. If you set this property to dtCustom you must create OnInitItem event handler or set DataClass property.
If this property is true, container will update owner's caption every time when you change FileName property.
If this property is true, file will be automatically loaded when you assign new value to FileName property. This feature may be especially useful to load data into container at design-time.
Define this handler to create data elements of your own type. This handler also useful to perform additional initialization for standard data elements.
Use this handler to display progress of time-consuming operations. See ShowProgress() method above.
Called when data in container are changed in some way. See Modified property above.
Write this handler if you want to sort data elements with Sort() method. Note that this handler must always return correct result!