Jump to content

Lajos Juhász

Members
  • Content Count

    820
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Lajos Juhász

  1. Lajos Juhász

    TIdSSLIOHandlerSocketOpenSSL.MaxLineAction issue.

    The source of Indy is delivered with Delphi so you can find it easily. It's in IdGlobal.pas.
  2. Lajos Juhász

    Quickly zero all local variables?

    IMHO it's not the sam RSP-24383 is about var parameters. The parameter intToStr is not a var parameter. For example: procedure TForm1.FormCreate(Sender: TObject); var i: record a,b,c: integer; end; a: integer; begin i.a:=i.b; IntToStr(a); IntToStr(i.c); end; I have only one warning: [dcc32 Warning] Unit1.pas(35): W1036 Variable 'a' might not have been initialized
  3. Lajos Juhász

    Quickly zero all local variables?

    I have found a case that there is no warning for records: procedure TForm1.FormCreate(Sender: TObject); var i: record a,b : integer; end; begin showmessage(IntToStr(i.a)); showmessage(i.a.ToString); end;
  4. Lajos Juhász

    Convert two Integers to a DateTime??

    If you have enough decimals you can do: Hours + minutes / 60
  5. Lajos Juhász

    Sidney, RestDebuger and REST

    Only if the QP entry is entered for released version of Delphi. The entries for beta versions are usually locked and can be seen only by the beta testers.
  6. Lajos Juhász

    When will IDE Editor support more fonts?

    Now I understand Unicode for now is only the subset of the Unicode that the Delphi IDE can display correctly and that's not the definition of a Unicode editor. The editor in the IDE can display only the subset of a Unicode.
  7. Lajos Juhász

    When will IDE Editor support more fonts?

    Are you sure about that? Pleas try to paste this to the IDE (example from: https://en.wikipedia.org/wiki/Precomposed_character) Åström (U+0041 U+030A U+0073 U+0074 U+0072 U+006F U+0308 U+006D) The result is: It doesn't render it well. If you assign this string to a label.caption then Windows will display it correctly: Even if I paste the code from Delphi here the forum can display it correctly. procedure TForm4.FormCreate(Sender: TObject); begin label1.Caption:='Åström (U+0041 U+030A U+0073 U+0074 U+0072 U+006F U+0308 U+006D)'; end;
  8. Lajos Juhász

    Filter on InternalCalc field

    My code is simple type TForm1 = class(TForm) FDConnection1: TFDConnection; FDQuery1: TFDQuery; FDQuery1field1: TStringField; FDQuery1calcfield: TStringField; DBGrid1: TDBGrid; DataSource1: TDataSource; Button1: TButton; procedure Button1Click(Sender: TObject); procedure FDQuery1CalcFields(DataSet: TDataSet); procedure FDQuery1FilterRecord(DataSet: TDataSet; var Accept: Boolean); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin FDQuery1.Filtered:=true; end; procedure TForm1.FDQuery1CalcFields(DataSet: TDataSet); begin dataset['calcfield']:=varToStr(dataset['field1'])+' data'; end; procedure TForm1.FDQuery1FilterRecord(DataSet: TDataSet; var Accept: Boolean); begin Accept:=copy(varToStr(dataset['calcfield']),1,1)='1'; end;
  9. Lajos Juhász

    Main Form appearing issue..

    I was able to reproduce this behavior when Application.MainFormOnTaskbar := false and the third form is modal with PopupParent is the mainform.
  10. Lajos Juhász

    Filter on InternalCalc field

    I've tried with calculated field to use in OnFilterRecord and it worked, the grid displayed only the filtered records.
  11. Lajos Juhász

    Filter on InternalCalc field

    Calculated fields are working in FireDAC and you can use them to display data. However, in order to filter data instead of filter property you can use the OnFilterRecord event. For Example: myQuery.Filter:='cTaxYear = ' + QuotedStr( '2008-09' ); myQuery.Filtered:=true; You can use: For query myquery and form myFormFRM you can write: myQuery.OnFilterRecord:=FilterTaxYear; myQuery.Filtered:=true; procedure myFormFRM.FilterTaxYear(DataSet: TDataSet; var Accept: Boolean); begin Accpet:=VarToStr(DataSet['cTaxYear'])='2008-09'; end;
  12. Lajos Juhász

    Filter on InternalCalc field

    According to my test with calculated fields you can use only the OnFilterRecord event to filter the data. In my test calculated field didn't worked as expected with the filter property. Is it a bug or buy design I have no idea only @Dmitry Arefiev could give an answer.
  13. Lajos Juhász

    TDBGrid - dgTitleClick

    Google returned this: http://www.drbob42.com/blog/Blog.aspx?RootId=5:3791 Delphi 2010 introduces theming for the TDBGrid control, using the DrawingStyle property (which can be gdsThemed (default), gdsClassic or gdsGradient) and introducing GradientStartColor and GradientEndColor for the latter. It's not the only change made to the TDBGrid control, unfortunately. New are also the dgTitleClick and dbTitleHotTrack flags in the Options property. And although there's no documentation for them in the help (yet), it's pretty obvious what they do. Specifically, setting the dgTitleClick flag in the Options property will ensure that the OnTitleClick event handler is called (when assigned) when someone clicks on the title. Their intended meaning isn't the issue here. And when you place a new TDBGrid component on a form, the options dgTitleClick and dbTitleHotTrack are included in the Options property by default. However... when you take an existing VCL forms application, and open it up with Delphi 2010, then these previously unknown Option flags will not be in the DFM file, so they will not be set, and hence dgTitleClick and dgTitleHotTrack will be false. And as a surprise the OnTitleClick event handler is no longer called. Simply by recompiling an existing Delphi VCL application in Delphi 2010. Ouch! So, if you or your customers suddenly find that clicking on TDBGrid titles no longer works, check the dgTitleClick flag of the Options property (of all your TDBGrids).
  14. Lajos Juhász

    Unfixed bug in Sydney

    We have zero information about what kind of bug is in the compiler. It can be a 5 second fix or can require a rewrite. I doubt that rollback to Delphi 10.3 is an option otherwise why would anyone change the compiler? As a software developers I think it is reasonable that we can understand that even that there is a bug for some cases nobody tries to rush fixes to be published and risk to introduce new bugs (and make the situation worse). For these kind of things it's better to test and be sure that it's working. BTW. I am also in the process to move from old versions to 10.4 and I am also not happy the state of the IDE and compiler (after these fixes and one minor version there are still known bugs).
  15. Lajos Juhász

    Application does not close

    It also can be that the application is generating a memory leak log when ReportMemoryLeaksOnShutdown := True it can take longer whene there is an extended leak to report.
  16. Lajos Juhász

    Is XML Documentation in Delphi 10.4 is 105% broken?

    The oldest bug report is from July and it's not marked as duplicated if it was a known issue they would flag it.
  17. Lajos Juhász

    Is XML Documentation in Delphi 10.4 is 105% broken?

    Unfortunately this is a well known bug in Delphi 10.4 - there was a bug report that I didn't found at first - https://quality.embarcadero.com/browse/RSP-30690 the report is from July an still open. I was a bit shocked that nobody noticed in the betas.
  18. Lajos Juhász

    Delphi Code-Insight problems

    You should also consider to enter a QP ticket for this. I believe for this case there is no ticket yet.
  19. Lajos Juhász

    Is XML Documentation in Delphi 10.4 is 105% broken?

    Unfortunately this is Help Insight. For example http://docwiki.embarcadero.com/RADStudio/Sydney/en/Help_Insight show a picture as it was in Delphi XE5. So the expected behavior is still to generate a readable definition of the function.
  20. Lajos Juhász

    Year Countsdown

    According to Delphi it's not 66 days but 67: Date: 15.02.2021 Days between: 67 program Project1; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils, System.DateUtils; var X: Tdate; begin try { TODO -oUser -cConsole Main : Insert code here } x:=IncDay(IncMonth(now, 2), 5); WriteLn('Date: '+DateToStr(x)); WriteLn('Days between: '+IntToStr(DaysBetween(x, now))); ReadLn; except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; end.
  21. Lajos Juhász

    Can you restart the LSP or do you have to restart the whole IDE?

    Also now it's running in separate process and will not bring / or slow / down the IDE. You can use the IDE to edit your code while the LSP processes are doing their jobs.
  22. Lajos Juhász

    Delphi and the new Apple M1 CPU

    According to the Roadmap (https://blogs.embarcadero.com/rad-studio-roadmap-november-2020/) in Delphi 10.5 H2 2021 you can expect a better support for the M1 CPU. In the roadmap it's under Platform Enhancements macOS ARM (Delphi). Of course as ever please do not forget this is only planned. There is no legal bound that it will be delivered in the first release of Delphi 10.5. A more detail can be found also at https://blogs.embarcadero.com/rad-studio-november-2020-roadmap-pm-commentary/ At this moment the best you can do is to wait for the first beta for Delphi 10.5.
  23. Lajos Juhász

    Prevent editing in a TComboBoxEx..

    I would just set the property Style to csExDropDownList.
  24. Technically there is no problem. However it could be improved: 1.) When _NewUnicodeString failes due to CharLength instead of _IntOver it should raise a more meaningful exception. For example: You cannot create string length of %d. 2.) The overflow occurs in GetTextStr. When debugging a 32 bit application you get the following call stack: :766f9ab2 KERNELBASE.RaiseException + 0x62 :41169900 :41169900 System.Classes.TStrings.SaveToStream($3033D38,???) System.Classes.TStrings.SaveToFile(???,nil) System.Classes.TStrings.SaveToFile(???) mainFRM.TForm1.Button2Click($2FCEEA0) Vcl.Controls.TControl.Click Vcl.StdCtrls.TCustomButton.Click SaveToStream is focused, this almost ok as this method calls GetTextStr. I've tried again to run the 64 bit version and I get a different call stack this time: System._RaiseAtExcept(???,???) System.SysUtils.ErrorHandler(???,$40FA0A) System.ErrorAt(5,$40FA0A) System._IntOver System._NewUnicodeString(1092000000) System._UStrFromPWCharLen('',nil {#0},???) System.Classes.TStrings.GetTextStr System.Classes.TStrings.SaveToStream($302DD30,$302CDD0) System.Classes.TStrings.SaveToFile('d:\temp\StringTest.txt',nil) System.Classes.TStrings.SaveToFile(???) mainFRM.TForm1.Button2Click(???) The IDE focuses System._IntOver instead of System._NewUnicodeString.
×