-
Content Count
2837 -
Joined
-
Last visited
-
Days Won
168
Everything posted by Uwe Raabe
-
Project Magician and Selective Debugging and Delphi 10.3 Rio
Uwe Raabe replied to Uwe Raabe's topic in Delphi Third-Party
Just uploaded V1.0.8 with Rio Support -
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/
-
Forward declarations
Uwe Raabe replied to Berocoder's topic in Algorithms, Data Structures and Class Design
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. -
Forward declarations
Uwe Raabe replied to Berocoder's topic in Algorithms, Data Structures and Class Design
No. you have to copy the methods from TPerson as abstract methods to TAbstractPerson. Any properties go to TAbstractPerson with abstract Getters and Setters. -
Forward declarations
Uwe Raabe replied to Berocoder's topic in Algorithms, Data Structures and Class Design
What about TPerson -> TAbstractPerson -> TAmStateObject ? -
Forward declarations
Uwe Raabe replied to Berocoder's topic in Algorithms, Data Structures and Class Design
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. -
How to deal with different types of Variant?
Uwe Raabe replied to Mike Torrettinni's topic in General Help
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; -
LiveBindings and evaluating logical expressions
Uwe Raabe replied to John Kouraklis's topic in RTL and Delphi Object Pascal
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? -
Strange Behaviour of FillChar for Non Byte Array Arrays.
Uwe Raabe replied to Ugochukwu Mmaduekwe's topic in RTL and Delphi Object Pascal
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). -
Strange Behaviour of FillChar for Non Byte Array Arrays.
Uwe Raabe replied to Ugochukwu Mmaduekwe's topic in RTL and Delphi Object Pascal
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. -
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.
-
I am not using SourceTree, so I cannot test. TortoiseHG has no problems cloning the repo.
-
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.
-
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.
-
MMX 14.0.4 can't open Unit Dependencies with Delphi 10.2.3
Uwe Raabe replied to ULIK's topic in MMX Code Explorer
Well, the OTA contains a few special interfaces regarding themes and the Unit Dependency Analyzer was the first form (or better frame in this case) making use of those. What I didn't know (because as usual those things are poorly documented - if at all) is that it seems to be forbidden to call ApplyTheme when IDE themes are disabled. Not that this could as well be caught inside ApplyTheme (just for safety - instead of crashing), so that not everybody has to add this additional check in their code. -
MMX 14.0.4 can't open Unit Dependencies with Delphi 10.2.3
Uwe Raabe replied to ULIK's topic in MMX Code Explorer
To be honest, I usually test only against an IDE with all options at default. It is near to impossible to test for all combinations. It was my hope that such things are discovered during the beta phase. -
Object Inspector Filter Box and keyboard navigation
Uwe Raabe replied to dummzeuch's topic in Delphi IDE and APIs
What about F11? -
@ULIK Oops! Please give version 14.0.4 a try.
-
Official version 14.0.3 with support for Delphi 10.3 is now available. There have been only some small bugfixes since the beta version (f.i. beta still used the v13 registry key).
-
Are you looking for Kiosk mode? Configure kiosks and digital signs on Windows desktop editions
-
Object Inspector Filter Box and keyboard navigation
Uwe Raabe replied to dummzeuch's topic in Delphi IDE and APIs
A plain <Enter> should do as well. -
Noted!
-
He was probably mislead by my code example, which actually was a console application.
-
As long as the form is derived from TDockForm there is no way to make it not dockable (after all that is the main purpose of a TDockForm descendant). On the other hand you are not forced to dock it in the first place. The desktop functionality isn't affected from the docking state. To store the last position of the floating window in the desktop it is sufficient to make it visible once any time before saving. It is not necessary to dock the form for that.
-
Seems you are looking for TTimeSpan: program Project458; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils, System.TimeSpan; var span: TTimeSpan; begin span := TTimeSpan.Subtract(EncodeDate(2018,1,2)+EncodeTime(16,35,0,0), EncodeDate(2018,1,1)+EncodeTime(15,30,0,0)); Writeln(Format('%d Day(s) %d Hour(s) %d Minute(s)', [span.Days, span.Hours, span.Minutes])); Readln; end.