Jump to content

uligerhardt

Members
  • Content Count

    83
  • Joined

  • Last visited

Posts posted by uligerhardt


  1. If you don't want to change the order of parameters you can use two overloaded  functions like this:

    interface
    
    function GetWeekDates(const GivenDate: TDateTime; const SOWDay: string; out startDate, endDate: TDateTime): Boolean; overload;
    function GetWeekDates(const GivenDate: TDateTime; out startDate, endDate: TDateTime): Boolean; overload;
    
    implementation
    
    function GetWeekDates(const GivenDate: TDateTime; const SOWDay: string; out startDate, endDate: TDateTime): Boolean;
    begin
      //...
    end;
    
    function GetWeekDates(const GivenDate: TDateTime; out startDate, endDate: TDateTime): Boolean;
    begin
      Result := GetWeekDates(GivenDate, 'SU', startDate, endDate);
    end;

    Alternatively, drop the overload and use different names like GetWeekDates and GetWeekDatesEx.

    • Like 1

  2. 28 minutes ago, Uwe Raabe said:

    Unfortunately that is by design as comments in uses clauses are considered not clean.

     

    Background: It is pretty hard to connect the comment to one of the used units - there is too much convention involved with this. Also, line end comments don't play well with grouping and line wrapping.

     

    There are non plans to change this any time soon.

    Thanks for the info, Uwe - I already suspected this. Fortunately, it's not a big problem. 


  3. Hi all,

     

    I recently started using UsesCleaner and mostly love it. One mildly annoying aspect is that it removes comments after units in the uses clause. I often have clauses like

    uses
      Unit1, // PALOFF - to suppress false positives from Pascal Analyzer 
      Unit2, // used because of some obscure reason
      Unit3; // TODO remove when ...
    

    and have to reinstate all the comments after using UsesCleaner. Is there a way to make UsesCleaner leave the comments in place?


  4. 2 minutes ago, Alexander Sviridenkov said:

    Thanks for reporting, this error appears when clickng to Create without selected project. Now fixed.

    Note that to select project you need to click on folder icon next to Project label

    I have the error when clicking on the folder icon without clicking Create. But I'll just try the new version. 🙂


  5. 5 hours ago, Van said:

    I've installed a new version of Delphi 11.3 on windows ll and I have the same problem with the form's right/bottom edges disappearing after you add a TTitlebar. The problem persists even after removing the Titlebar.

    Any idea how to resolve this?

    Never used TTitlebar but this sounds like there are related units left in the uses clause after removing the component. So maybe the problem hides in some initialization section?


  6. If you're prepared to write a wizard you might find something in this fragments from a very old wizard I no longer use:

    procedure TMyWizMainForm.ShowInMessageView(const FileName, MessageStr: string;
      LineNumber, ColumnNumber: Integer);
    var
      MessageServices: IOTAMessageServices40;
    begin
      MessageServices := BorlandIDEServices as IOTAMessageServices40;
      MessageServices.ClearCompilerMessages;
      MessageServices.ClearToolMessages;
      MessageServices.AddToolMessage(FileName, MessageStr, '.....', LineNumber, ColumnNumber);
      ShowMessageView;
    end;
    
    procedure TMyWizMainForm.ShowUnitSource(const FileName: string);
    begin
      (BorlandIDEServices as IOTAActionServices).OpenFile(FileName);
    end;
    
    procedure TMyWizMainForm.ShowParseError(e: EParseError);
    var
      EditorServices: IOTAEditorServices;
      TopView: IOTAEditView;
      EditActions: IOTAEditActions;
    begin
      ShowInMessageView(CurrUnit, e.Message, e.LineNo, e.ColumnNo);
      EditorServices := BorlandIDEServices as IOTAEditorServices;
      TopView := EditorServices.TopView;
      if TopView = nil then
      begin
        ShowUnitSource(CurrUnit);
        TopView := EditorServices.TopView;
      end;
      if TopView <> nil then
      begin
        EditActions := TopView as IOTAEditActions;
        EditActions.NextError;
      end;
    
      Close;
      Beep;
    end;

    It works (worked?) by inserting a custom line into the IDE's message window and make the IDE jump there.

    • Like 1
×