Jump to content

Uwe Raabe

Members
  • Content Count

    2750
  • Joined

  • Last visited

  • Days Won

    162

Everything posted by Uwe Raabe

  1. Uwe Raabe

    Breakpoints do not work.

    If Debug-DCUs is not active there will be no blue dots in the Delphi sources.
  2. Uwe Raabe

    Breakpoints do not work.

    Only when you want to break or step into the Delphi units.
  3. Uwe Raabe

    Memory leak with anonymous methods.

    When I run that code in a vanilla VCL Forms Application in a ButtonClick event - nothing happens. Either commenting out the last line or inserting a Sleep(100) before makes the ShowMessage appear. The problem here is that the anon method captures the variable and not the value. Thus setting the value of TerminateProc to nil has influence of what is passed to TThread.Queue. It heavily depends on the timing of whether the Queue call comes first or the setting to nil. Seems not to be a valid solution to avoid the leak.
  4. Uwe Raabe

    Call for Delphi 12 Support in OpenSource projects.

    There are different levels of beta testers...
  5. Another approach would be to declare a TMessage descendant that the frame (and probably also any form) subscribes to during creation and unsubscribes from on destruction. Then you can broadcast this message when the language changes. uses System.Messaging; type TLanguageMessage = class(TMessage<string>); ... procedure TMyFrame.HandleLanguageMessage(const Sender: TObject; const M: TMessage); begin var msg := M as TLanguageMessage; SwitchToLanguage(M.Value); end; ... TMyFrame.Create FLanguageMessageID := TMessageManager.DefaultManager.SubscribeToMessage(TLanguageMessage, HandleLanguageMessage); ... TMyFrame.Destroy TMessageManager.DefaultManager.Unsubscribe(TLanguageMessage, FLanguageMessageID, True); ... NotifyLanguage TMessageManager.DefaultManager.SendMessage(nil, TLanguageMessage.Create('DE'));
  6. Uwe Raabe

    Call for Delphi 12 Support in OpenSource projects.

    You mean, that I am part of the beta? That is already known in public IAW Embarcadero: TZipFile Improvements in Delphi 12
  7. Uwe Raabe

    Call for Delphi 12 Support in OpenSource projects.

    During the beta I use private forks of the public repositories to store all the changes. On release date the fork is merged into public. I don't distinguish code I may publish or not.
  8. AFAIK, the TNT Unicode Components were acquired by TMS a couple of years ago, but they are tagged compatible up to Delphi 10.2 now: TMS Unicode Component Pack - looks like they are just abandoned.
  9. Uwe Raabe

    How to remember tests in VCL GUI Logger

    You can always tweak the source of DUnitX.Loggers.GUI.VCL.pas to your needs. Currently the code for saving is located in FormClose. Besides extracting it to a dedicated method, it can be inserted at the beginning of RunExecute. In Contributing.md you find instructions to make your enhancements available for all.
  10. Uwe Raabe

    %G equivalent in FormatFloat?

    Well, the FormatFloat implementation has the E15 hardcoded and even documented:
  11. Uwe Raabe

    %G equivalent in FormatFloat?

    Well, FormatFloat acts as expected; for var I := 1 to 10 do Writeln(FormatFloat('', I/10)); for var I := 1 to 10 do Writeln(FormatFloat('', I*Power10(1, 14))); Output:
  12. Uwe Raabe

    %G equivalent in FormatFloat?

    Have you tried with AxisValueFormat being empty?
  13. Uwe Raabe

    Installing Delphi with an MSA

    At least that is how I read the license:
  14. Uwe Raabe

    Delphi DUnitx unit test and project dependencies

    When you create a new test project and add one of the units for testing, the project won't compile unless all dependent units can be found. So you need to add the search paths accordingly. There is nothing wrong with having dependencies in the first place. It just makes picking only one unit from the project into another one a bit difficult. Nevertheless, it is always worth thinking about minimizing dependencies, but not only because of simpler testing. The not seems appropriate, but the term project to be tested should be changed to test project.
  15. It depends on the actual sources. I have had projects that just needed a compile with the new version and target, while others lasted several months.
  16. That could even be simplified to: for var btn in [Button1, Button2, Button3, Button4, button5] do btn.Enabled := not btn.Enabled;
  17. First of all, keeping the default names for the buttons has never been best practice. While suggesting to have descriptive names for the buttons, this nevertheless is another way to iterate over any group of buttons: for var btn in [Button1, Button2, Button3, Button4, Button5] do btn.Enabled := True; And, no, you can't write [Button1..Button5] here.
  18. The order of units with initialization code are better retrieved by the C=ICODE entries instead of the C=CODE ones.
  19. Looks like it comes from GExpert.
  20. AFAIK; the initialization order of units follows the order of the ICODE (Initialization Code-Segment) segments in the Detailed map of segments in the map file.
  21. IMHO using inline variables and with together looks somewhat strange.
  22. Uwe Raabe

    How can I get this code formatting ?

    You may have hard time to find something like that, because IMHO your formatting is not consistent: After then the begin is in the next line, but after else it is not. It probably boils down to having to write your own formatter.
  23. Uwe Raabe

    Library for modifying windows PE files?

    Which APIs are you looking for?
  24. Uwe Raabe

    Round UpTo 1 Level up

    The corresponding function is Ceil.
×