-
Content Count
2837 -
Joined
-
Last visited
-
Days Won
168
Everything posted by Uwe Raabe
-
Increasing registration count not possible without active maintenance support
Uwe Raabe replied to Leif Uneus's topic in Delphi IDE and APIs
Although it has been mentioned before: The license isn't invalidated after subscription has run out. It keeps working and it can even be installed on another system. In case the installation counter needs to be bumped one has to contact Embarcadero Sales (in contrast to Support while on subscription) to get this increased. I have not heard of anyone where that has been denied. -
Can you list the corresponding QP issues. I would like to have a look at that to push it a bit.
-
DUnitX passed in params are confusing
Uwe Raabe replied to JamieMi's topic in RTL and Delphi Object Pascal
Indeed, a bit sad. I still have hope that this will get some traction shortly. It might be worth to know that a fork of that repo, namely https://github.com/UweRaabe/Delphi-Unit-Tests, is actually part of the regression tests run by Embarcadero. It also has a couple of contributors as well as branches, albeit lacking some activity, too. -
AFAIK, that is simply not meant to work in the first place.
-
DUnitX passed in params are confusing
Uwe Raabe replied to JamieMi's topic in RTL and Delphi Object Pascal
The point is that if you want to test for invalid parameters, you have to pass them inside another test method instead of a separate test case. Currently we have one test method procedure TestAdd(Value1, Value2, _Result: Int64); Unfortunately we don't have the implementation, so I have to do a bit of guessing here: procedure TMyTestClass.TestAdd(Value1, Value2, _Result: Int64); begin Assert.AreEqual(_Result, Add(Value1, Value2)); end; Whatever is passed to the TestAdd method, the parameters given to the Add method are always valid types. To test some invalid parameter we need another test method TestAddInvalidParams passing invalid parameters to the Add method. procedure TMyTestClass.TestAddInvalidParams; begin // call Add with some invalid params and chec if it fails end; Passing invalid parameters to TestAdd via a TestCase attribute only tests the capability of DUnitX to detect invalid parameters in a TestCase attribute. It does not test Add to fail with invalid parameters. BTW, whether you even can pass invalid parameters to Add depends on the declaration of Add which we cannot see. -
Create a new instance of a generic class
Uwe Raabe replied to A.M. Hoornweg's topic in RTL and Delphi Object Pascal
Even if it would compile this way, it is quite possible that it does not do what you expect it to do: result := tSomeclass<T>(Classtype).Create(fSomeParameters); -
DUnitX passed in params are confusing
Uwe Raabe replied to JamieMi's topic in RTL and Delphi Object Pascal
Seems your are trying to test the test method or even DUnitX here instead of the method of your math unit. -
While Delphi 12 supports ZIP encryption, the actual encryption algorithm has to be provided by the developer itself or a library implementing the new IZipCryptor interface. For the common PKWARE Zip 2.0 encryption (see APPNOTE.TXT) an implementation can be found in PKWAREZipCryptor.pas. The usage is shown in the following example, which extracts all files from an encrypted zip file: var bytes: TBytes; fileName: string; zipFile: TZipFile; begin zipFile := TZipFile.Create; try zipFile.Cryptor := TPKWAREZipCryptor.Create; zipFile.Password := cPassword; zipFile.Open(zipFileName, zmRead); for var I := 0 to zipfile.FileCount - 1 do begin fileName := zipFile.FileNames[I]; zipFile.Read(I, bytes); TFile.WriteAllBytes(fileName, bytes); end; zipFile.Close; finally zipFile.Free; end; end;
-
Delphi 12 Athens Refactoring Broken
Uwe Raabe replied to Navid Madani's topic in Delphi IDE and APIs
https://docwiki.embarcadero.com/RADStudio/Athens/en/What's_New#Moving_Deprecated_Features -
Delphi 12 Athens Refactoring Broken
Uwe Raabe replied to Navid Madani's topic in Delphi IDE and APIs
AFAIK, the plan was to make Refactoring opt-in, but it came with other regressions when not installed. So they finally made it opt-out. Anyway. It is commonly known since ages that any 0-release is not made for production. Let's wait for the first hotfix - at least. -
Delphi 12 Athens Refactoring Broken
Uwe Raabe replied to Navid Madani's topic in Delphi IDE and APIs
It is deprecated because it is broken beyond repair. Better stop using it. -
Delphi 12 IDE, cannot create regions
Uwe Raabe replied to A.M. Hoornweg's topic in Delphi IDE and APIs
It is broken as it makes one assume the report is not created while actually it is. This leads to multiple duplicates, but filing a report is still possible. Just make sure to check for existence after creation before trying again to avoid these duplicates. -
Delphi 12 IDE, auto-formatter mutilates generics
Uwe Raabe replied to A.M. Hoornweg's topic in Delphi IDE and APIs
They found - what everyone else claimed for a long time - that it didn't keep up with the latest language enhancements. As it is based on other deprecated parts (i.e. Refactoring), they consequently marked it deprecated, too. Now they are working on or looking for replacements. Communicating that something is deprecated without having an alternative at hand is not necessarily a bad thing. People now know it advance what they can expect and rely on and what not. -
It seems that the most effective incentive to use CE is: It's free.
-
Because a CE license is valid for one year only. After that you have to request a new CE license which will only work with the current CE version.
-
Gitlab-ci & MSBUILD & Library path
Uwe Raabe replied to LaurentGirard's topic in Delphi IDE and APIs
Not sure it is related, but there is a very inconsistent use of slash and backslash in the $env values. -
Delphi 12: Install Packages inconsistency?
Uwe Raabe replied to PeterPanettone's topic in Delphi IDE and APIs
Actually that looks like a reason to keep the current behavior instead of implementing the proposed one: -
Delphi 12: Install Packages inconsistency?
Uwe Raabe replied to PeterPanettone's topic in Delphi IDE and APIs
It would have the drawback that packages are loaded and unloaded again when the same project (or another with the same package requirements) is opened next. So the current implementation may just be some sort of performance optimization. IMHO, it is sufficient when there are no packages missing after the next project is loaded or a new one created. Can you explain what practical benefits the requested behavior would have? -
I would split removing the bracketed strings and removing double blanks in separate methods. I am assuming the strings are well-formed here, which means that each opening bracket matches a closing bracket, no orphaned brackets and no nesting. Otherwise use one of the other algorithms shown above. function RemoveInBrackets(const AString: string): string; begin var arr := AString.Split(['(', ')']); for var I := High(arr) downto 0 do begin if Odd(I) then Delete(arr, I, 1); end; Result := string.Join('', arr); end; function RemoveDoubleBlanks(const AString: string): string; begin Result := string.Join(' ', AString.Split([' '], TStringSplitOptions.ExcludeEmpty)); end;
-
If the drawing code is too time consuming for being called in OnPaint, you might consider drawing to a bitmap when something changed and draw that bitmap in OnPaint.
-
TFDBatchMove with non NULL column in target table
Uwe Raabe replied to TurboMagic's topic in Databases
You need to give way more information about your components and their properties. F.i. setting Direct in a TFDBatchMoveDataSetWriter will probably not call Append and thus OnNewRecord is not called. Also using an TFDBatchMoveSQLWriter will not call OnNewRecord either. -
TFDBatchMove with non NULL column in target table
Uwe Raabe replied to TurboMagic's topic in Databases
If the source table doesn't provide a value for that column, you need to do that yourself, which implies that you know which value has to be written to that field. Depending on your batch move architecture, that might be done in OnNewRecord of the target dataset or OnWriteRecord of TBatchMove. -
It could be even shorter: Result := MyStr.Remove(MyStr.IndexOf('<')).Trim; No need to check for existence as the internally called _UStrDelete already handles that case pretty well.
-
It is a long time flaw in the TMS package naming to neglect the LIBSUFFIX approach, which ever so often leads to such problems. That's why I have made my own packages using LIBSUFFIX in conjunction with a manual install process. It comes with the task to synchronize the DPR files contains clause for each update - a small price I am happy to pay.
-
Better or not often is a matter of preference and personal needs. I for myself already gave a hint before: The availability of a stand alone and command line tool are a big plus for me. Side note: I have licenses for and actually worked with both, which helps to make a less biased comparison.