Say that I have the following record:
type
TTest = record
test1 : TTest1;
test2 : TTest2;
test3 : TTest3;
end;
pTTest = ^TTest;
TDictestDictionary = TDictionary<integer,pTTest>;
testDictionary : TDictestDictionary
Will it be sufficient to write
testDictionary := TDictionary<integer,pTTest>.Create;
and then add the items like:
testDictionary.AddOrSetValue(1,pValue);
or need to initialize pValue ?
But then what happens when:
GetMem(pValue, Value);
testDictionary.AddOrSetValue(1,pValue);
FreeMem(pValue);
will the items remove the data pointed by pValue ?
Please Help
Also, on the same line of thought, can I have something like this:
Type
myClass = class(TObject)
private
FTest : TDictestDictionary ;
public
property propFTest : TDictestDictionary read getFTest() write setFTest()
but then how I write getFTest() setFTest()
Help. Thank you
testDictionary[1].test1 = ...
will create copy of record and will not affect value in dictionary. In such cases you need to store record pointers – teran