-
Content Count
2541 -
Joined
-
Last visited
-
Days Won
147
Posts posted by Uwe Raabe
-
-
That is correct! With 10.3 there is no difference in TBytes and TByteDynArray. Both are TArray<Byte>. You can simply remove the TByteDynArray overload when compiling for 10.3.
- 2
-
The process of updating GetIt packages is just too clumsy to keep pace with new releases.
- 1
-
There is an unofficial download available for MMX Code Explorer with Delphi 10.3 Rio support. Unofficial because it didn't have had much testing yet due to some incompatibilities found during the beta phase. One of this results in the loss of the MMX editor context menu entry.
Another big change ist that MMX version 14.x only supports Delphi 10 Seattle and higher. For that, version 13 will still be available for download and installations for older Delphi versions should keep working. I had to make this cut to avoid wasting too much time just to make it work and test it on those older versions.
Nevertheless there are some features and bug fixes:
- Unit Dependency Analyzer is now dockable (so you can see immediately when you introduce cyclic dependencies)
- New settings page Project Options (currently contains only the setting for Uses Clause Sorting). These settings are stored per project in a separate section of the dproj file.
- Uses Clause Sorting accepts lists like (ToolsApi,DesignIntf) as one group. This only affects grouping, so the order inside this list is not relevant.
- Uses Clause Sorting accepts wildcards like Rz* (for Raize Components) or Id* (for Indy) to better handle non-dotted unit names
- New sorting options "group class members" - keeps the class methods together
- fix: Wrong result when renaming parameter during Extract Method
- fix: Add Local Variable now also works with For-In clause
- fix: Hard coded string scan check for min length works correct now
- fix: Paste Interface in empty class just works now
- fix: Consolidated behavior of selected file in Open/Use Unit dialog
- fix: Creational Wizard follows static/non-static when suggesting destructors
Some work has been done for supporting themes, but that is still a long road to go.
Please report any bugs and problems found either here or via support@mmx-delphi.de.
- 5
- 7
-
12 minutes ago, Georgge Bakh said:For example, some third unit3 used TClass1 from the unit1 from which we moving TClass1 to unit2. In order to keep the code correct we need to update unit3 accordingly.
No, you have to add unit2 to the uses clause of unit3 manually. You might also be able to remove unit1 from the uses clause.
-
Can you give an example what you mean by "updated automatically" in this context?
-
The Owner is not necessarily the form. Sometimes the owner is a TFrame descendant or may even be nil.
Iterating the Parent until a TCustomForm is found is usually the way to get the required form instance. Perhaps iterating until Parent is nil is another valid approach. That would also cover the case where one form is parented into another one.
- 5
-
You can also search the registry. The Package Cache key (like HKEY_CURRENT_USER\Software\Embarcadero\BDS\19.0\Package Cache) contains all installed packages with all its components.
-
2 hours ago, Schokohase said:I can only change the var records.
Extend the record a bit and try again (so it doesn't fit into a register):
TTestRec = record dummy: array[1..10] of Integer; Value: Integer; procedure Change( AValue: Integer ); end;
- 2
-
It is still possible to change the fields of a const record parameter when you use one of its own methods to do that.
-
Look at the different overloads of GetFiles and use that one matching your needs. If you have to specify TSearchOption.soAllDirectories you should specify that to the appropriate overload.
files := TDirectory.GetFiles('C:\Temp\', TSearchOption.soAllDirectories, function(const Path: string; const SearchRec: TSearchRec): Boolean begin Result := TPath.MatchesPattern(SearchRec.Name, '*.exe') or TPath.MatchesPattern(SearchRec.Name, '*.dll'); end);
- 1
-
If you want only files use GetFiles. If you want only folders use GetDirectories. If you want both use GetFileSystemEntries. You don't need multiple calls - at least I can't imagine a use case for it in the moment. If you want all DLL and EXE files use the code I gave as an example.
The Embarcadero example above selects the correct method to call depending on the given parameters - admitted in a somewhat weird way. It never calls more than one GetXXX method, because the three if-clauses are mutually exclusive.
BTW, the loop to add the LList to the TStringlist can be replaced by a simple AddStrings call in recent Delphi versions.
Also returning a TStringList instance as a function result is not a first class approach anyway. That's why all the IOUtils functions return string arrays.
-
TDirectory.GetFiles/GetDirectories/GetFileSystemEntries have overloads taking a TFilterPredicate. You can provide your own accept function with that. The following example lists all dll and exe files from the given folder in one go.
files := TDirectory.GetFiles('C:\Temp\', function(const Path: string; const SearchRec: TSearchRec): Boolean begin Result := TPath.MatchesPattern(SearchRec.Name, '*.exe') or TPath.MatchesPattern(SearchRec.Name, '*.dll'); end);
- 3
-
You can even shorten the TURL.Create by introducing a function URL wrapping around that. This is similar to TRect.Create and Rect. As a drawback it somewhat litters your scope.
- 1
-
Project Magician has an option to strip all version info from child configurations. That way the values from the base (platform if you have non-Windows targets) configuration are effective. It doesn't hinder you to edit any child values, though - they just have no effect any more.
https://www.uweraabe.de/Blog/2018/05/17/keep-your-project-files-clean-with-project-magician/
- 2
-
35 minutes ago, KodeZwerg said:and IOUtils offer TPath, where i have less experience.
I guess you are referring to TDirectory.GetFiles here as TPath has no such functionality. Well, that is merely a wrapper for FindFirst/FindNext so not actually a new approach and such not worth investigating in terms of speed over convenience.
-
3 hours ago, bernau said:Is there any description available? What is the function of the Code Coverage Plugin? Do you have Screenshots?
I will fill up these gaps as soon as I find some time.
-
1 hour ago, Wosi said:Great! What's about this:
const RESTClient = TRESTClient.Create(Nil);
Does it work?
At least it compiles...
- 1
-
I have just uploaded the sources for the Code Coverage Plugin shown during my session at EKON 22 on Monday. Besides its functionality it may also give some guidance on writing IDE plugins in general.
https://bitbucket.org/uweraabe/codecoveragemagician
Tested only on Delphi 10.2.3 Tokyo!
- 4
- 4
-
7 hours ago, Wosi said:Marco says in his blog post:
So I think constant value expressions are evaluated at compile time. But I would love to see inline constants initialized with dynamic values just like in TypeScript.
Well, this works:
begin var I := 20; const J = I-1; Writeln('I=', I); Writeln('J=', J); end;
- 1
-
The correct declaration would be:
type TPerson = class Name: string; function ToString(Quote: boolean): string; reintroduce; overload; end;
- 2
- 1
-
Well, you might as well add that FrameWork_$(FrameworkType) define directly to your project. That is mostly what @Markus Kinzler suggested before and limits the use to the current project, while the UserTools approach works for any project. In case of your library you would have to do that for each of its projects. Perhaps you can simplify it using an OptionSet.
-
Embarcadero could use the same approach as above in one of the target files in the Delphi bin folder. They already do similar things in there. I guess it is time to file a QP report for that.
-
Create or extend a file named UserTools.proj in %APPDATA%\Embarcadero\BDS\19.0 (for 10.2 Tokyo) with the following code:
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <DCC_Define>FrameWork_$(FrameworkType);$(DCC_Define)</DCC_Define> </PropertyGroup> </Project>
Now you can check for the project framework with {$IFDEF FrameWork_VCL} and {$IFDEF FrameWork_FMX}.
- 2
- 4
-
If you read it as ODER BY ROW, COLUMN it makes sense, but I am not sure that it matches the actual context.
Project Magician and Selective Debugging and Delphi 10.3 Rio
in Delphi Third-Party
Posted
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)