Jump to content

Uwe Raabe

Members
  • Content Count

    2718
  • Joined

  • Last visited

  • Days Won

    160

Everything posted by Uwe Raabe

  1. In addition you have to add a registry entry in the appropriate BDS Experts key similar to that in the Tokyo one. When I find some time I might add a proper setup.
  2. Uwe Raabe

    Format uses clauses for many units

    Not from inside MMX, but there is a command line tool (see attached). You only have to provide a settings file, like the example provided. UsesCleaner.zip
  3. Uwe Raabe

    ThemesEnabled deprecated..

    I am pretty sure that your code is inside a class derived from TCustomStyleServices (unless you are using with). As ThemesEnabled is a member of TCustomStyleServices so is Enabled. Simply change that ThemesEnabled to Enabled and you should be fine.
  4. Given that file access is almost sequential (remember how hard drives work), I assume that the OS will serialize those parallel tasks in the end anyway. But perhaps I am just missing something.
  5. Uwe Raabe

    MMX for Delphi 10.3 Rio

    Actually, I would hate reading such code. It is distracting and extends the amount to read with no real information gain. It's a TButton - I don't care where it is declared. If I want to know I use Code Insight. There already is such an AddIn and it is called Pascal Expert. The corresponding report is STWA2:
  6. Uwe Raabe

    MMX for Delphi 10.3 Rio

    If Contains means a simple text search and given your example above, that would return the first unit where TButton is used or declared. Actually, there exists something like that in MMX used for auto adding units to the uses clause when a specific type is used (see General Settings under Parsing). Unfortunately, in my opinion, that too often gives false results, because it relies on pre-scanned units and not resolving the units found inside the uses clauses.
  7. Uwe Raabe

    MMX for Delphi 10.3 Rio

    Let's take that as a sign that implementing this feature is probably far from easy.
  8. Uwe Raabe

    MMX for Delphi 10.3 Rio

    Unfortunately that is way more complicated than resolving the unit scope names. It requires to find out where that identifier is declared with respect to the current scope and uses clauses. While Code Insight does have this information and therefore can offer this "Find Declaration" functionality (with all its quirks), MMX does not and it is not planned to support it. Perhaps, when somewhere in the future MMX uses some sort of compile or syntax check, this might be easier to implement. For the moment it is simply out of bounds. BTW, one of the advantages of MMX is that it usually still works even when the code does not compile. That is because it doesn't use a compiler to analyze the sources.
  9. Uwe Raabe

    MMX for Delphi 10.3 Rio

    No.
  10. The idea was that the search paths are taken from the current project configuration. Seems like that is not the case here. I wonder if these settings will become obsolete whenever that mechanism actually works and they are auto-updated whenever the project or its current build configuration changes. That would leave the $IF Expressions and the Lattix LDP file as the only adjustable values (not sure if the latter is actually used by anyone else than myself).
  11. I wonder if the situation on G+ has been any different.
  12. Just uploaded V1.0.8 with Rio Support
  13. This release addresses problems with disabled IDE themes and Delphi 10.2 Tokyo releases below 10.2.3 (and some smaller bugs): https://www.mmx-delphi.de/2018/12/31/bugfix-release-for-mmx-code-explorer/
  14. Uwe Raabe

    Forward declarations

    Basically it is like declaring the class interface where it is needed and move the implementation to another unit. Very similar to interfaces - just another approach.
  15. Uwe Raabe

    Forward declarations

    No. you have to copy the methods from TPerson as abstract methods to TAbstractPerson. Any properties go to TAbstractPerson with abstract Getters and Setters.
  16. Uwe Raabe

    Forward declarations

    What about TPerson -> TAbstractPerson -> TAmStateObject ?
  17. Uwe Raabe

    Forward declarations

    Besides Interfaces there are also abstract classes to accomplish this. unit TestA; interface type TAbstractTestB = class public procedure Test; virtual; abstract; end; TTestA = class public M_TestB: TAbstractTestB; constructor Create; end; implementation uses TestB; constructor TTestA.Create; begin inherited Create; M_TestB := TTestB.Create; end. unit TestB; interface uses TestA; type TTestB = class (TAbstractTestB) M_TestA: TTestA; public procedure Test; override; end; implementation procedure TTestB.Test; begin end; end. Depending on where M_TestB is assigned, you assign either a TTestB instance or create one. You can even create that instance inside TTestA as you are allowed to use unit TestB in the implementation section of TestA as shown above. Nevertheless I suggest to remove these cyclic class dependencies altogether, but the way to do so depends heavily on your use case and the framework you are using.
  18. Uwe Raabe

    How to deal with different types of Variant?

    There are several functions to simplify your task. You can use VarIsStr to check for string variants and VasIsOrdinal for the Integer case. Also there is VarToStr to convert a Variant to string. With this you can strip down your compare function to function CompareValues(const aValue1, aValue2: Variant): integer; overload; Begin Result := 0; // if ANY of the values is string, should compare as strings! if VarIsStr(aValue1) or VarIsStr(aValue2) then Result := CompareValues(VarToStr(aValue1), VarToStr(aValue2)) else if VarIsOrdinal(aValue1) and VarIsOrdinal(aValue2) then // Make sure that the following cast succeeds! Result := CompareValues(Integer(aValue1), Integer(aValue2)); End;
  19. Seems you are mixing a boolean expression and a logical operator here ("=" is not a logical operator!). What do you expect from an expression like True and 8?
  20. In general, no! Unless, in very specific scenarios, when the number you want to fill the array with consists of four similar bytes (like $04040404).
  21. FillChar is a byte oriented method it will fill the underlying memory with the given number of bytes of the given value. Check Sizeof(a) and you will see that it is 24 and not 6. The UINT32 cast has no effect as FillChar will only use the lowest byte of that parameter.
  22. Uwe Raabe

    Blast from the past: BDE and Win10 W/S

    It is indeed quite a while since I had to cope with BDE problems, so my suggestion might be pretty outdated now. Nevertheless you can give it a try as it is only a small change in the registry. What helped us in the past was disabling opportunistic locking at the server side (where the database files reside). For this you have to change the value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters\EnableOplocks from 1 to 0 (as 1 is the default value, it might even be absent). Note that you have to restart Windows to make this change effective. A drawback of this setting is a possible overall network performance drop for that server system.
  23. Uwe Raabe

    IDE Code Coverage Plugin available

    I am not using SourceTree, so I cannot test. TortoiseHG has no problems cloning the repo.
  24. Uwe Raabe

    IDE Code Coverage Plugin available

    Unfortunately, yes! Currently that is the only way to do that. I am aware that there is plenty of room for improvement in this plugin.
  25. Uwe Raabe

    MMX for Delphi 10.3 Rio

    Unfortunately it is not easy to implement this. You will find the same problem with other IDE plugins trying to do the same. Unless someone finds a valid solution for this problem and is willing to share it I may need some time to invent something by myself.
×