Jump to content

Lars Fosdal

Administrators
  • Content Count

    3319
  • Joined

  • Last visited

  • Days Won

    110

Everything posted by Lars Fosdal

  1. Lars Fosdal

    TortoiseGit with Delphi 10 Seattle

    Kinda hard to do proper multi-branch management from within the Delphi IDE.
  2. Lars Fosdal

    TortoiseGit with Delphi 10 Seattle

    I use GitKraken outside of the IDE, following the same modus operandi as @Roger Cigol
  3. Lars Fosdal

    problem upgrading to Delphi 11.1 Patch 1

    I ran the patch from GetIt in the IDE directly. No such messages for me on my Windows 10.
  4. Lars Fosdal

    RAD Studio 11.1 Patch 1

    For those that do High-DPI, are we now at a point where a multi-developer team w/mixed DPI systems can work on the same project without screwing up the layout / scaling?
  5. Lars Fosdal

    GameVision Toolkit

    I haven't been on Facebook since 2018, and I am not going there again.
  6. Lars Fosdal

    How to get json array from string?

    Another method to do JSON to Object. unit StructureTestTypes; interface uses REST.Json, System.SysUtils; type TStructure = class(TObject) // '{"RESULT":200, "IDLIST":[1,2,3,4,5]}' private FIDLIST: TArray<Integer>; FRESULT: integer; public constructor Create; virtual; destructor Destroy; override; property RESULT: integer read FRESULT write FRESULT; property IDLIST: TArray<Integer> read FIDLIST write FIDList; end; implementation { TStructure } constructor TStructure.Create; begin SetLength(FIDLIST, 0); end; destructor TStructure.Destroy; begin SetLength(FIDLIST, 0); inherited; end; end. Test Program: program JsonStructureTest; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils, REST.Json, StructureTestTypes in 'StructureTestTypes.pas'; var Test: TStructure; begin Test := TJson.JsonToObject<TStructure>('{"RESULT":200, "IDLIST":[1,2,3,4,5]}']); try try Writeln('Result: ', Test.RESULT); Write('IDList:'); for var i in Test.IDLIST do Write(' ', i ); Writeln; except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; finally Test.Free; Writeln; Write('Press Enter: '); Readln; end; end.
  7. Lars Fosdal

    Survey of Delphi Versions in use??

    It may make sense to use an external survey service and post a link to it on prominent Delphi sites. That will enable better version coverage in the survey.
  8. Lars Fosdal

    Free eBook : Delphi High Performance

    Or just buy it and support the author.
  9. The lack of an Enumeration constraint is one of my big annoyances with Delphi Generics. No support for ord, pred, succ, or set of, in, or other set operators.
  10. Lars Fosdal

    tMainmenu DPI issue

    Do you know if there is a QP report for this issue?
  11. Lars Fosdal

    So here's my challemge...

    @Fr0sT.Brutal Valid point on the auto increment.
  12. Lars Fosdal

    So here's my challemge...

    Doesn't this mean that if you have two devices accessing the same database, they can create duplicate AssetKeys? I prefer to use auto incremented ID fields in the database. If I was being security minded - I would also add GUID identities per row so that it would be much harder to abuse Id values in illegitimate queries if the keys are exposed in a web or REST UI. MS SQL example CREATE TABLE [dbo].[t_company_code]( [CoyId] [int] IDENTITY(1,1) NOT NULL, [CoyCode] [nchar](3) NOT NULL [CoyCreated] [datetime] NOT NULL ) ON [PRIMARY]; GO ALTER TABLE [dbo].[t_company_code] ADD CONSTRAINT [DF_t_company_code_Created] DEFAULT (getdate()) FOR [CoyCreated]; GO CREATE TABLE [dbo].[t_assets]( [AssetId] [int] IDENTITY(1,1) NOT NULL, [CoyId] [int] NOT NULL, [Description] [nchar](63), [AssetCreated] [datetime] NOT NULL ) ON [PRIMARY]; GO ALTER TABLE [dbo].[t_assets] ADD CONSTRAINT [DF_t_Asset_Created] DEFAULT (getdate()) FOR [AssetCreated]; GO -- You would then use a view to join them CREATE VIEW [dbo].[v_CoyAssets] AS SELECT dbo.t_company_code.CoyId, dbo.t_company_code.CoyCode, dbo.t_company_code.CoyCreated, dbo.t_assets.AssetId, dbo.t_assets.Description, dbo.t_assets.AssetCreated FROM dbo.t_company_code INNER JOIN dbo.t_assets ON dbo.t_company_code.CoyId = dbo.t_assets.CoyId; GO and do a select from the view SELECT CoyCode, AssetId from v_CoyAssets order by CoyCode, AssetId;
  13. Lars Fosdal

    Is TEdit bugged with mobile? Since when?

    If that is the case, it sounds like a bug.
  14. Lars Fosdal

    Digital Persona UAreU 4500 Fingerprint Reader ActiveX

    How old is the device? Does it come with an installer for the ActiveX driver? If you can identify the installed ActiveX control, you can in Delphi use the menu entry Component | Import Component... and choose either the Type Library or the ActiveX Control, depending on what you have at hand. If the device is old and you lack drivers - you would probably save money by finding a replacement.
  15. Lars Fosdal

    Several F2084 Internal Error on Delphi 10.4.2

    It is often possible to reduce the problem to a small example - it just that it is sooo much work - and hey, we don't work in EMBT QA. Edit: ... or do we?
  16. Lars Fosdal

    Windows Dayligthsaving problem

    I leave the PC and IDE running 24/7 (unless travelling). I do however check in to git before I go have a beer on Friday 🙂
  17. Lars Fosdal

    Windows Dayligthsaving problem

    I´m still annoyed with the fact that not even a running Delphi is able to appropriately deal with DST changes while running. "No, all those files didn´t change... the time did."
  18. @de la Mancha- you asked and got a relevant answer from someone known for doing heavy math with Delphi. No reason to be rude.
  19. Lars Fosdal

    Is TEdit bugged with mobile? Since when?

    On Android, you should be able to move the caret to the right by tapping and dragging?
  20. Lars Fosdal

    Indy & OpenSSL 1.1.1 & TLS 1.3

    I am getting questions about supporting TLS 1.3 on our https interfaces again...
  21. Lars Fosdal

    .NET kill the Delphi IDE

    IMO, The .NET bits should be replaced instead of once more being patched to fix the broken code completion and refactoring.
  22. Lars Fosdal

    Several F2084 Internal Error on Delphi 10.4.2

    Closed as cannot reproduce. Without sample code that actually can reproduce the problem, it is impossible to resolve the cause.
  23. Lars Fosdal

    function error

    It is a problem that you have zero error handling around the Win32 operations in the Cmd method. Without the precise error information from the failing API(s), we are completely in the dark. F.x. if CreateProcess fails, you need to call GetLastError and log or pass on the error info somehow. Almost every Win32 API method will update last error.
  24. Typed consts are not consts unless you type them on the right side of the expression. const NotAConst: Integer = -1; IsAConst = Integer(-1); The record type simply becomes a "scope" for const declarations. Benefit: the consts can be non-uniquely named without polluting your name spaces since you always need to prefix with the type name to access the const. Added bonus - you can have methods in the record declaration that can deal with logical operations related to the constants. type cButton = record const ThisIsFine = mrOK; end; cAnswer = record const ThisIsFine = String('This is fine'); end; cLimit = record const ThisIsFine = Double(3.14); end;
  25. Lars Fosdal

    function error

    Without the actual error(s), we'll be guessing. Is it lack of process security elevation so that it fails due to insufficient rights?
×