2
The MemDS unit contains a TMemDataset class. It implements an in-memory
5
- The data can be loaded from/to Stream or file.
6
This can be automated by setting the 'FileName' property.
7
- The data can be copied from another dataset.
11
Property FileName : String;
13
If set, the data is loaded from this file when opening the dataset, and saved
14
when it is closed (and modified).
16
procedure CreateTable;
18
Creates the needed in-memory structures after fielddefs were added.
19
See testpop.pp for an example.
21
function DataSize : Integer;
23
Size of data in memory.
25
procedure Clear(ClearDefs : Boolean);
28
Clears the data. If cleardefs=True, then fielddefs are cleared.
29
If the definitions are cleared (default), the dataset is closed.
31
Procedure SaveToFile(AFileName : String);
32
Procedure SaveToFile(AFileName : String; SaveData : Boolean);
34
Save Data to file. If SaveData=False, then only metadata is written.
36
Procedure SaveToStream(F : TStream);
37
Procedure SaveToStream(F : TStream; SaveData : Boolean);
39
Save Data to stream. If SaveData=False, then only metadata is written.
41
Procedure LoadFromStream(F : TStream);
43
Load Data from a file created with savetofile.
45
Procedure LoadFromFile(AFileName : String);
47
Load Data from a stream, created with saveto stream.
49
Procedure CopyFromDataset(DataSet : TDataSet);
50
Procedure CopyFromDataset(DataSet : TDataSet; CopyData : Boolean);
52
Copy data from another dataset. Only fields (not fielddefs) are copied.
53
The dataset must be open. If CopyData is false, only the field definitions
54
are copied, but no data is copied. By default, data is also copied.
56
Property Modified : Boolean Read FModified;
58
Indicates whether the in-memory data was modified. When data is modified,
59
and the dataset is closed, the data is saved to stream if the 'filename'