Jump to content

Uwe Raabe

Members
  • Content Count

    2718
  • Joined

  • Last visited

  • Days Won

    160

Everything posted by Uwe Raabe

  1. Uwe Raabe

    operator overloding Equal vs Multiply

    In Delphi a set is denoted with square brackets. Unfortunately a constant array is also denoted with square brackets. I have to admit that I am not happy with this language design decision either. The term [10] as well as (i being an integer) can be both a set or array constant. There is no rule for the compiler to choose one or another. There are scenarios where the compiler chooses different than the developer intended. If you feel that the compiler is doing wrong here, please open a bug report with this example.
  2. Uwe Raabe

    operator overloding Equal vs Multiply

    Probably because in the second case "[10]" is seen as a set constant by the compiler. It works if you declare a variable with a proper type: var b: boolean; a: array of Integer; r: TMyRecord2; begin try a := [10]; r := r * a; // this line is compiled b := r = a; // this line is not compiled except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; end.
  3. As I am still looking for a usable GIT client that matches the ease of the TortoiseHG workbench, I should probably evaluate SourceTree again.
  4. The components you see in the Form Designer are those inside the BPL loaded at design time. As long as you don't re-compile this BPL you will work with the old version of the component. This can be different than the version compiled into your EXE, as long as the new source files are found somewhere in your search path.
  5. This is an class approach. The benefit is the full encapsulation of the private parts inside the implementation section. unit uGlobalData; interface type TGlobalData = class type TValue = record ValName: string; ValInProject: boolean; end; public { these should probably be properties instead } Id: Integer; RecName: string; Values: TArray<TValue>; procedure PrepareGlobalRec; virtual; abstract; end; function GlobalData: TGlobalData; implementation type TGlobalDataImpl = class(TGlobalData) private type TLocalRec = record LocalRecStr: string; // ... end; procedure LocalProc1; procedure LocalProc2; var LocalStrVar: string; LocalRecVar: TLocalRec; public procedure PrepareGlobalRec; override; end; procedure TGlobalDataImpl.LocalProc1; begin end; procedure TGlobalDataImpl.LocalProc2; begin end; procedure TGlobalDataImpl.PrepareGlobalRec; begin // prepare GlobalRec data LocalStrVar := 'local test'; LocalRecVar.LocalRecStr := 'test'; LocalProc1; LocalProc2; end; var GlobalDataInstance: TGlobalData = nil; function GlobalData: TGlobalData; begin if GlobalDataInstance = nil then begin GlobalDataInstance := TGlobalDataImpl.Create; end; Result := GlobalDataInstance; end; initialization finalization GlobalDataInstance.Free; GlobalDataInstance := nil; end.
  6. Uwe Raabe

    10.2 Tokyo unable to report issues from within the IDE

    This has been the case for quite a while. The URL points to the defunct QualityCentral.
  7. Uwe Raabe

    RIO - FDMemTable fielddefs design time bug ?

    Indeed! I can reproduce it with IDEFixPack installed.
  8. Uwe Raabe

    RIO - FDMemTable fielddefs design time bug ?

    Cannot reproduce. Datatype dropdown list contains unique values here.
  9. Uwe Raabe

    Add Indexer problem

    I wonder how this folder is going to be used as Shared folder. For a non-admin installation that should rather be %APPDATA%\Raabe Software\Shared and not %APPDATA%\Raabe Software\MMX Code Explorer. On the other hand I can imagine some buggy setup scheme from my side. So whatever that registry RootDir entry points to, copy the Indexers folder into that folder and you should be done. I will investigate the setup for any glitches - or better - rethink the folder architecture in general.
  10. Uwe Raabe

    Add Indexer problem

    The Indexer templates are expected in the Indexers sub folder from the shared folder set in registry under HKEY_CURRENT_USER\Software\Raabe Software\Shared\RootDir. It is quite possible that something went wrong during the installation and the indexer files were not copied to that folder. I will check the setup for that.
  11. Uwe Raabe

    Is it really good practice to create Forms only as needed? Always?

    For these cases I prefer moving the settings to a separate settings class independent from the settings form. Then I can create and initialize an instance of this settings class at startup, load the settings from some storage and adjust with some command line parameters. Then the settings are available all over the application without having to rely on the settings form creation. I often have the case where I need access to the settings long before the main form is created. This would be hard to achieve using the settings form as the central storage for the settings.
  12. High(x) is implemented as Dec(Length(x)), while Low(x) can already be evaluated by the compiler. High and Length have some execution overhead to check for a nil array, so caching the value might be worth it.
  13. Uwe Raabe

    Travis CI joins Idera

    The time saved by using ContinuaCI and FinalBuilder is worth much more than the cost for these tools - unless you are working for free, though. When comparing prices, don't forget to compare benefits, capability and comfort. Free is never an argument on its own. Oh, and the Solo version of ContinuaCI actually is for free. I tried several times to make use of Jenkins (actually I started with Hudson), but each time I gave up due to the effort necessary to get things done and the maintenance being a bit cumbersome (to speak nicely). So no one can say I didn't give it a chance. ContinuaCI has still room for improvement, no question, but @Vincent Parrett and his team are always open for feature requests and usually amazingly fast when it comes to fixing bugs.
  14. The unthemed IDE is totally different. BTW, that screenshots somehow reminds me of Delphi 7 (which really makes me shudder).
  15. Uwe Raabe

    Travis CI joins Idera

    Indeed! The time and effort to get a build project up and running (and actually doing what you want!) in ContinuaCI and FinalBuilder beats Jenkins by magnitudes.
  16. Actually, I don't know and, to be honest, I don't care much. Usually there are other places slowing down a program and the gains from rethinking an algorithm or an architecture are probably better targets.
  17. Well, it doesn't - it stands for Light/Dark Theme and Desktop (at least the rectangle behind it).
  18. Talking about pedantic: The name len is probably misleading, as when it is used in MyArr[Len] it doesn't represent the actual length of the array any more. In contrast MyArr[High(MyArr)] is always correct. Nevertheless, caching the index might be a good idea anyway: It eliminates some checks - and High(x) needs one additional DEC operation compared to Length(x).
  19. In modern Delphi versions I try to combine record constructors and array concatenation to achieve that: program Project481; {$APPTYPE CONSOLE} type TSomeRec = record SomeField: Integer; public constructor Create(ASomeField: Integer); end; TMyArr = TArray<TSomeRec>; constructor TSomeRec.Create(ASomeField: Integer); begin SomeField := ASomeField; end; procedure Main; var myArr: TMyArr; myRec: TSomeRec; begin myArr := [TSomeRec.Create(0), TSomeRec.Create(1)]; myArr := myArr + [TSomeRec.Create(2)]; Insert([TSomeRec.Create(3)], myArr, 1); for myRec in myArr do begin Writeln(myRec.SomeField); end; Readln; end; begin Main; end.
  20. Project Magician and Selective Debugging are supporting Delphi 10.3 Rio. https://www.uweraabe.de/Blog/2018/11/23/delphi-10-3-rio/ (with download links)
  21. Nothing specific. Does it show in the Info - About dialog under Installed Products? Does the Project Magician menu item exist under the Project menu? BTW, the latter will also give you access to the Global settings.
  22. … reset the IDE Insight toolbar! When IDE Insight suddenly stops working…
  23. Exactly! Check Supported Target Platforms: http://docwiki.embarcadero.com/RADStudio/Rio/en/Supported_Target_Platforms
  24. Uwe Raabe

    Include unused class and its RTTI in the executable

    In case the compiler can evaluate that condition, that might be an issue, but there are many ways to play on the safe side there. Actually creating and freeing the class may come with some costs, though.
  25. Uwe Raabe

    Include unused class and its RTTI in the executable

    That is pretty similar to the original approach described in the topic. In addition, there it is wrapped in a never-true condition to avoid being executed.
×