Jump to content

Uwe Raabe

Members
  • Content Count

    2750
  • Joined

  • Last visited

  • Days Won

    162

Everything posted by Uwe Raabe

  1. Uwe Raabe

    D5 data file misread in XE program

    Did you try Double Word?
  2. Uwe Raabe

    Delphi 12.1 is available

    It is OK. The long name is Delphi 12 Update 1.
  3. Uwe Raabe

    D5 data file misread in XE program

    The data file has 140.748 bytes - that doesn't work well with 971 records, but with 951 records with 148 bytes each. That record size also matches the actual file content. You may get better results with this declaration: lexrec = record root_part: string32; filler: string[2]; case speech_part: valid_range of - 1: (suppletive_type: supp_rec); 0: (nsupp_type: integer); 1, 2, 3, 4, 5: (normal_type: normal) end;
  4. Uwe Raabe

    Simpel types

    Note that the Implicit string operator can make you fall into the same parameter order trap as AddToStock is for NativeInt. To avoid that, you may prefer to replace the operator with a dedicated ToString function, keeping the original call to ShowMessage: type TProductID = record ID: nativeint; public class operator Explicit(A: TProductID): NativeInt; overload; class operator Implicit(A: NativeInt): TProductID; overload; function ToString: string; end; class operator TProductID.Explicit(A: TProductID): NativeInt; begin Result := A.ID; end; class operator TProductID.Implicit(A: NativeInt): TProductID; begin Result.ID := A; end; function TProductID.ToString: string; begin Result := ID.ToString; end; --- procedure TForm6.AddToStock(pid: TProductID; cnt: nativeint); // Both uses internally nativeint begin ShowMessage(pid.ToString); end;
  5. Uwe Raabe

    Simpel types

    One option would be to add some operator overloading to TProductID: type TProductID = record ID: nativeint; public class operator Explicit(A: TProductID): NativeInt; overload; class operator Implicit(A: NativeInt): TProductID; overload; class operator Implicit(A: TProductID): string; overload; end; class operator TProductID.Explicit(A: TProductID): NativeInt; begin Result := A.ID; end; class operator TProductID.Implicit(A: NativeInt): TProductID; begin Result.ID := A; end; class operator TProductID.Implicit(A: TProductID): string; begin Result := A.ID.ToString; end; This allows to write something like this: var cid : TCustomerID; var pid: TProductID; pid := qryGetStockProductID.AsInteger; cid := qryGetStocCustID.AsInteger; --- procedure TForm6.AddToStock(pid: TProductID; cnt: nativeint); // Both uses internally nativeint begin ShowMessage(pid); end; Note that the operator to convert TProductID to NativeInt is Explicit instead of Implicit. That prohibits the use of TProductID as a NativeInt parameter and the compiler throws an error when the parameters to AddToStock are given in the wrong order.
  6. I guess that is caused by the {$ELSE} part of the TESTINSIGHT conditional. You can safely remove that: System.SysUtils, {$IFDEF TESTINSIGHT} TestInsight.DUnitX, {$ENDIF } DUnitX.Loggers.Console, DUnitX.Loggers.XML.NUnit, DUnitX.TestFramework,
  7. AFAIK, that Package output directory is only used when you build a package (hence the name). For other projects the Output directory is used. In other words, the DRC file is always placed where the compiled binary goes.
  8. Uwe Raabe

    Regression - Delphi 12 - IsZero()

    I have written a couple of applications for CNC machines. The majority are for wood working and those usually have a resolution of 0.001 mm. Therefore the Epsilon used for matching element start/end points is set to 0.0005. When calculating parallel contours there often are cases where very small elements appear that have to be removed and the disjunct neighbors need some trimming to an intersection. These cases need a much finer epsilon than the first one. Side note: Regression tests comparing float calculations created under Win32 can easily fail when executing on a Win64 platform.
  9. Uwe Raabe

    Regression - Delphi 12 - IsZero()

    I beg to differ here. The approach is to have a decent epsilon when no one is given. It doesn't prohibit anyone to give an epsilon appropriate to the current scenario. The default values currently used actually cover a common beginner's mistake assuming that floats can be compared for exact equality. Usually the IsZero implementation works pretty good for the majority of the cases - at least those I encountered myself. Perhaps you just never stumbled about code using them appropriately?
  10. Uwe Raabe

    Regression - Delphi 12 - IsZero()

    Actually, they are not that magic:
  11. Uwe Raabe

    Use Interbase Developer license on 2 Windows PCs?

    Actually that is not the case. The developer license is needed for the Interbase Server, while the Client doesn't need a license - only access to the Interbase Server (i.e. the server PC has to be up and running and the client needs to establish a connection to it). Regarding the Firebird suggestion: Don't try to install Firebird (Server or Client) on a PC where Interbase already is installed unless you know exactly what you are doing. Most likely you will break at least one of these installations.
  12. Uwe Raabe

    Regression - Delphi 12 - IsZero()

    As far as I can see there are no changes in the implementation. Also a quick console example shows no regression. Can you please provide the source for your test case to verify? BTW, could it be only a problem with Watch Variables?
  13. I'm not sure if that is what you are after: Dataset Enumerator Reloaded. The current location for the unit described in that article is now on GitHub as part of my CmonLib library: https://github.com/UweRaabe/CmonLib/blob/main/source/Cmon.DataSetHelper.pas The code allows to retrieve the current record of a dataset either as a record or a class. The record example shown in the article requires the declaration of a record type [DBFields(mapAuto)] TEmployee = record EmpNo: Integer; LastName: string; FirstName: string; PhoneExt: string; HireDate: TDateTime; Salary: Double; end; With that you can retrieve the data of the current dataset record like this: var Employee: TEmployee; begin { Show the employee's name and the hire date. } Employee := QuEmployee.GetCurrentRec<TEmployee>; ShowMessage(Format('%s %s was hired on %s', [Employee.FirstName, Employee.LastName, FormatDateTime('dddddd', Employee.HireDate)])); end; The article also has another example using a class instead of a record.
  14. Seems to be a known issue: https://quality.embarcadero.com/browse/RSP-23505 Assuming that the Tools - Editor - Line Endings setting is still set as default, the question is: Why doesn't the IDE fix these wrong line endings to CRLF on loading?
  15. Uwe Raabe

    Close current form when opening other form

    The question is: Do you want the current form to close before you have entered the data in the new one or after that?
  16. I suggest to open a support ticket for Registration & Installation via https://www.embarcadero.com/support
  17. Uwe Raabe

    DBCheckbox uncheck all

    As long as you don't change it, any field in a new record is initialized with Null. A TDBCheckBox displays a NULL as grayed - that is what you see. The easiest way to avoid this is to wire the OnNewRecord event of the dataset and initialize the relevant fields with False.
  18. Uwe Raabe

    Assign Null value to date mySQL

    How do you currently write a date?
  19. Uwe Raabe

    Check if selected row in DBGrid

    Perhaps I have a different concept of selected, but any non-empty dataset always has a current record, wich is where the indicator is when dgIndicator is part of the options. The field values from the dataset resemble this current record/row. In addition to this current row, a TDBGrid also has some SelectedRows represented by a TBookmarkList. So with do you mean the current row or the bookmark list?
  20. Uwe Raabe

    Hunting a unit reference

    You need Version 13.1.0.2220 for that.
  21. Uwe Raabe

    FloatToJSON

    Probably because of this one: https://quality.embarcadero.com/browse/RSP-38387
  22. Uwe Raabe

    Hunting a unit reference

    You can check the map file. In case you are already using MMX, its Analyze Unit Dependencies feature might help, too.
  23. Konopka Signature VCL Controls (KSVC), formerly known as Raize Components and available via GetIt.
  24. Uwe Raabe

    TFrame versus SubForm

    Using the same TVirtualImageList for several forms will fail if these forms are placed on monitors with different DPI. One of the main tasks of TVirtualImageList is to adjust the size of its images to match the DPI of the form. To achieve this they have to be owned by the form. See TVirtualImageList.DPIChangedMessageHandler.
  25. Uwe Raabe

    TFrame versus SubForm

    I wonder how subforms work under High-DPI conditions. There are several places in this area where a TForm is acting different to a TFrame.
×