Jump to content

Josep

Members
  • Content Count

    11
  • Joined

  • Last visited

Everything posted by Josep

  1. Josep

    SQL date problem

    Hello, with SQL Server you can use: ... WHERE cast(MyDateTime As Date) = :MyDate ... to truncate the time of MyDateTime field. More info in: https://stackoverflow.com/questions/923295/how-can-i-truncate-a-datetime-in-sql-server/923322
  2. Josep

    Google Charts in uniGUI

    Hello, I have published in github my components to generate charts in uniGUI using de Google Charts API. The components support the following types: Annotation Area Bar Bubble Calendar Candlestick Column Combo Diff Donut Gantt Gauge Geo Histogram Intervals Line Organization Pie Sankey Diagram Scatter Stepped Area Table Timeline Tree Maps Trendlines Waterfall Word Trees The library includes in demos folder the GChartsDemo project with several examples that show how to build the different class charts. When running the demo you can: Display the Delphi Code used to generate the Chart Click Google Guide button to see the official documentation of Google Charts. Click on the Chart to see fired events You can get the source code in https://github.com/JosepPages7/Delphi-GCharts
  3. Josep

    TJsonTextWriter out of memory

    Hello, I Use a combination of TStreanWriter with TJsonTextWriter. I write an array of more than 1.000.000 objects with no memory errors, during all process it uses the same 15 mb o RAM. Sample: procedure WriteJSONStream(const FileName: string); var StreamWriter: TStreamWriter; begin StreamWriter := TStreamWriter.Create(FileName); try WriteStream(StreamWriter); finally StreamWriter.Free; end; end; procedure WriteStream(TextWriter: TTextWriter); var ArrayBuilder: TJSONArrayBuilder; Writer: TJsonTextWriter; Obj: TJSONCollectionBuilder.TPairs; Arr: TJSONCollectionBuilder.TElements; begin // ExeuteQuery FQuery.Open; // -- Writer := TJsonTextWriter.Create(TextWriter); try ArrayBuilder := TJSONArrayBuilder.Create(Writer); try Arr := TJSONArrayBuilder(Builder).BeginArray; while not FQuery.eof do begin Obj := Arr.BeginObject; with Obj do begin Add('Field1', FQueryField1.asString); Add('Field2', FQueryField2.asString); // ... end; Obj.EndObject; FQuery.Next; end; Arr.EndArray; finally ArrayBuilder.Free; end; finally Writer.Free; end; end;
  4. Hi Uwe, thank you for your observation. I maked some tests and I realised that in "Release Mode" the units that are in the "search path" of my project, are the ones that "Find Declaration" don't work, but the units included in the project or the standard units like Vcl.forms, ... then "Find Declaration" works.
  5. I my case, I found the problem: When I have LSP activated and the application configuration build is in "RELEASE" mode, it is when "Find Declaration" don't work. If the configuration build is in "DEBUG" mode, then "Find Declaration" goes correctly!
  6. I have the same problem, finally I switched to "Delphi (Classic Code Insight)" and it works fine. But now it's a bit annoying that after doing a "Find Declaration" in the Code Editor, the cursor every two seconds shows the hourglass.
  7. Josep

    FireDAC and pooling random error

    Is threade safe declare "bEnd" an used as global var? var bEnd : Boolean = False;
  8. In previous versions of Windows 10, I also had this problem, but with the current version I use (1909) it works normally.
  9. Josep

    Hands-On Design Patterns with Delphi

    Today I needed to program a "Pool Manager" and luckily, on thursday I bought the two versions of this fantastic book "print + epub version", and in chapter 2 I found a great example "Object Pool Manager", which is precisely what I need. Thank you very much to the author.
×