Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 07/19/21 in all areas

  1. pyscripter

    New Community Edition

    In case you have not seen it: Delphi & C++Builder Community Editions Now Available in Version 10.4.2! (embarcadero.com)
  2. Dave Nottage

    TJSONObject.Format bug

    I used @Lars Fosdal's code: https://github.com/DelphiWorlds/Kastri/blob/672522381e8fe192f562cdcb95b9f473b08fc0b6/Core/DW.REST.Json.Helpers.pas#L77 Works better than the Format method, for me 🙂
  3. Der schöne Günther

    TJSONObject.Format bug

    I don't know how to reproduce. This here runs fine: program Project1; {$APPTYPE CONSOLE} uses System.JSON; const the_resp = '{"msg": "you get ... 100 % satisfaction"}'; the_resp2 = '{"msg": "you get \"... 100 % satisfaction\""}'; DEF_INDENT = 2; var doc: TJSONObject; formatted: String; begin doc := TJsonObject.ParseJSONValue(the_resp) as TJSONObject; formatted := doc.Format(DEF_INDENT); WriteLn(formatted); doc := TJsonObject.ParseJSONValue(the_resp2) as TJSONObject; formatted := doc.Format(DEF_INDENT); WriteLn(formatted); end.
  4. Lars Fosdal

    TListView filled by Thread = Freeze

    I usually do this as a two pass operation. I first start a thread that fills a memory structure. Once the thread is done, I trigger an update in the main thread that fills the UI from the memory structure. I have nothing but negative experiences with doing UI updates directly from threads.
  5. Dalija Prasnikar

    TListView filled by Thread = Freeze

    You have a deadlock. Waiting for background thread in main thread that uses Synchronize is recipe for disaster. Namely, when you start waiting you are blocking main thread until thread is finished, but when thread encounters Synchronize it will try to execute that code in the context of the main thread, but since main thread is on hold at that time Synchronize will never be able to run and finish. You should use TThread.Queue instead.
×