Jump to content

Uwe Raabe

Members
  • Content Count

    2907
  • Joined

  • Last visited

  • Days Won

    169

Posts posted by Uwe Raabe


  1. There is a new beta available. Changing the version number to 15 resembles not only the completely different new look due to theme support and new icons, but also the internal changes necessary to make all this work. Hopefully I didn’t break too much.

    • Like 3
    • Thanks 10

  2. 1 hour ago, Bill Meyer said:

    Moreover, I want to organize so that Delphi library modules are in the first grouping, then third-party, and last, units of the application. And then, of course, to provide for walking the file tree and applying changes to each application module found in the map file. 

    Are you interested to do some testing?


  3. Well, the actual problem here are the conditionals around the uses keyword and the closing semicolon. The rest inside is fine.

     

    This version is handled without problems:

    {$if defined(DEBUG) or defined(DEBUG_SPECIAL)}
    uses
    {$IFDEF DEBUG}
      dialogs
    {$ENDIF}
    //<some comment about the following ifdef>
    {$IFDEF DEBUG_SPECIAL}
      mmsystem, // timeGetTime()
      messages
    {$ENDIF}
      ;
    {$ifend} 

     


  4. While working on a tool for cleaning up uses clauses I stumbled upon this beast (slightly changed to protect the innocent):

    {$if defined(DEBUG) or defined(DEBUG_SPECIAL)}
    uses
    {$ifend}
    {$IFDEF DEBUG}
      dialogs
    {$ENDIF}
    //<some comment about the following ifdef>
    {$IFDEF DEBUG_SPECIAL}
      mmsystem, // timeGetTime()
      messages
    {$ENDIF}
    {$if defined(DEBUG) or defined(DEBUG_SPECIAL)}
      ;
    {$ifend} 

    If you are only looking for uses clauses inside some Delphi sources and try to avoid a full featured parser, you will have a pretty hard job to detect, parse and interpret that one correctly.

     

    So, if you are interested to make any use of such a tool, please do me a favor: Don't write your code that way! It is hard to read for humans anyway.

    • Like 1
    • Confused 1

  5. 24 minutes ago, Attila Kovacs said:

    Maybe because I have Autosave Project Desktop on?

    Habits and expectations differ, so setting this option to ones personal favor is not bad in the first place. There is only one thing to remember when switching that off: The project desktops are opened in the state they were last saved.

     

    To solve your problem:

    • switch this option on
    • load a project
    • close all forms
    • close the project
    • switch option off again

     

    • Thanks 1

  6. You can use the approach shown in TArray from System.Generics.Collection:

     

    type
      TMyExtArray = class(TArray)
      public
        class procedure DeleteElement<T>(var Values: TArray<T>; const Index: Cardinal);
      end;
    
    class procedure TMyExtArray.DeleteElement<T>(var Values: TArray<T>; const Index: Cardinal);
    begin
      if (Index < Low(Values)) or (Index > High(Values)) then begin
        raise EArgumentOutOfRangeException.Create('argument out of range');
      end;
      System.Delete(Values, Index, 1);
    end;

    Note that handling different types (intrinsic, pointer, reference counted) in the implementation part can be a bit tricky.


  7. In my Rio installation GenDocCLI.exe can be found in the Delphi bin folder. Also the context menu of the project model has a Generate documentation item. Are you aware that these features are part of Architect and Enterprise only?

     

    The Tools menu entry is also missing here. Actually I cannot remember even having it seen before.

×