Jump to content

Lars Fosdal

Administrators
  • Content Count

    3343
  • Joined

  • Last visited

  • Days Won

    111

Posts posted by Lars Fosdal


  1. Not sure if Totalling fields is the best example for the use case, as that is far more efficient to do in the queries

    3 hours ago, Tommi Prami said:

    So implementation should be kind that works if I have no control over the API of the class..

    By API, do you mean the interface section of the class?
    The challenge is that you need a predictable way to associate the fields with the field name.


    You could write a routine like this

    procedure ConnectFields(Query: TDataSet; const Fields: TArray<TField>; const Names: TArray<string>);
    begin
      Assert(Length(Fields) = Length(Names), 'Number of fields and number of names must match');
      for var ix := 0 to Length(Fields) - 1
      do begin
        Fields[ix] := Query.FieldByName(Names[ix]);
        if not Assigned(Fields[ix])
        then raise Exception.Create(Format('Field %s not found.', [Names[ix]]); 
      end;
    end
      
    // usage
    var
      Field1, Field2, Field3, Field4: TField;
    begin
      ConnectFields(Query,
       [ Field1,   Field2,   Field3,   Field4], 
       ['Field1', 'Field2', 'Field3', 'Field4']);
    ...

     which doesn't save you that much code, really.


  2. I got a Lenovo P16 (i7)64Gb/ 1TB+500GB Workstation Laptop, and run "corporate" Windows 10 latest patches on the WS and Win11 Pro on a Hyper-V VM.

    This machine is my regular work machine and it runs an SQL Server instance on the primary OS as well.

     

    I also have a private MacBook Pro M1 16" with 32GB and 2TB, running Parallels and Win 11 for ARM on a VM, and RHEL on a VM.

     

    Delphi installs and runs just fine on both Win 11 VMs.

    Interestingly, the MBP is faster than the P16 for the VMs, staying cool and silent, while the P16 spins up the fans like a turbine.

     

    I haven't tried dongles on my VMs, since signing happens on the corporate build server, but both VM hosts can pass through USB ports, so I would expect it to work.

    • Like 2

  3. Personally, I wouldn't use a visual component as the core.  It binds you to just one of the many platforms such a comms lib could be used on.

    Once you have a platform agnostic comms lib, you could base a VCL component on top of it.
     

    Now you just need to document the rest of your functional requirements and add pointers to some actual documentation and examples.

     

    If it looks interesting enough, maybe someone will take on the task.

     

    Good luck.


  4. 12 hours ago, techdesk said:

    Delphi help desk system

    This is NOT a help desk system. Delphi-PraXiS operates independantly from EMBT and the PEOPLE here are are professional software developers and hobbyists.

    This is a place that exists for users of Delphi to discuss the challenges they have when developing in the language.

     

    Any discussion needs clearly stated and accurate facts about the challenge at hand, for people to be able to contribute with suggestions for a solution. Lack of such detailed facts, will lead to requests for more facts, and AI generated bulldroppings are generally not considered to be facts.
     

    12 hours ago, techdesk said:

    Make a standalone program with a Form, Button and Memo with STM32CUBE IDE.

    We still have no clue to what this actually does or how it is supposed to work. We are not mind readers.

    • Draw a mockup of how you imagine this to look  
    • Describe the functionality in detail 
    • What that Button does
    • What is shown or entered in the Memo

    Just dropping a product name does not enlighten us at all.  We've likely never used the product and have no clue what it does or how it is supposed to work.

    • Like 2
×