Questions tagged [tdictionary]

38 questions
0
votes
0 answers

How to handle duplicate TDictionary error

how to handle the error of duplicate value in the list. Values are fed into the input and entered into the list. If there is a duplicate then the value is renamed. eg: procedure TForm2.Button1Click(Sender: TObject); var CollectionNameTable :…
0
votes
1 answer

What's the best way to re-index a TDictionary?

I have a TObjectDictionary, and TMyObject has an ID field that's the key. The dictionary owns the values. The keys originally come from a sequence generator, so as deletes and inserts occur, the key values become non-sequential…
0
votes
1 answer

Delphi read-only generics like TDictionary and TList are thread safe?

Can I add items in a Generic list or dictionary only in the unit initialization and then use it as read-only for multiple threads? I read in a topic that TList is thread safe and in another topic that TDictionary is not. What would be the…
0
votes
2 answers

Access Violation in TDictionary

I just wrote a very simple class to test the TDictionary<> Class in Delphi XE8. When i try to show the records that i added, it brings me an Access Violation error, i don't understand why? Here is my class unit Unit3; interface uses Classes,…
Fabien Fert
  • 95
  • 2
  • 11
0
votes
1 answer

Access TDictionary item

I am testing the TDictionary using the embarcadero sample ( http://docwiki.embarcadero.com/CodeExamples/XE5/en/Generics_Collections_TDictionary_%28Delphi%29 ) No problem for creating and adding key and value. However, when I try to access the table…
-1
votes
1 answer

How can I avoid EInvalidPointer error when using TObjectDictionary in Delphi?

The program receives product information datas through window message. Incoming datas processed in TProductInstance.PutProductData procedure. Product information contains date, name, price. I want to store datas as TObjectDictionary. The key is same…
gentlejo
  • 2,690
  • 4
  • 26
  • 31
-1
votes
2 answers

How do i fill a TDictionay from a list of comma-separated string pairs?

I want to have a text file with a list of strings (say for example comma separated with key and values that I can use for auto replacement) and store each key-value pair in a TDictionary. How do I populate the dictionary?
user1817376
  • 107
  • 11
-2
votes
1 answer

Delphi TDictionary : values are replace automatically when have the same key

I am using delphi XE5. This a resume of my code, Next code works, but there have to be something in my code that destroy normal behaviour: unit Class1; type TClass1 = class private FDic:TDictionary.Create; public constructor…
Max1298492
  • 91
  • 3
  • 8
1 2
3