Jump to content

Berocoder

Members
  • Content Count

    93
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by Berocoder


  1. 10 hours ago, David Heffernan said:

    Pascal Analyser is wrong. Seems pointless to test with is TBoldObject and then cast with as. Once is tells you the cast is valid then go ahead and use an unsafe cast. 

     

    Seems dubious to cast one object to be a class from an unrelated hierarchy. Don't know how that could be valid. 

     

    Also, what is BoldObjectIsDeleted all about? Don't tell me this flag is set to true when the instance is destroyed. 

    Yes, BoldObjectIsDeleted is true when object is deleted in memory but remain in database. On next sync memory to database it will be removed from database as well.
    But how that works is unrelated to question in this case.


  2. This is the code for Supports method. I know the name is bad, SysUtils.Supports is different. But we use this on thousands of places. Too late to change now.

    Now I also use Pascal Analyzer. That give a warning STW10

    Out parameter is read before set (STW10)

     

    This section lists out parameters that are read before set in the procedure.

    https://www.peganza.com/PALHelp/clip0211.png
     

    And yes it is correct. First line

      TObject(ResObj) := nil;
     

    Read the out parameter before set it.
    ResObj have no class in parameter. Reason is that we want to send any subclass derived from TBoldObject.
    If I set type to TObject that would not work any more.

    Any suggestion how I can remove the warning and still preserve the implementation ?

     

    {: Casting between two objects derived from two different classes
    Resobj must inherit from aObject
    @param aObject The object to cast from
    @param aClass The class to cast to
    @ResObj The resulting object
    @return True if successful otherwise false}
    function Supports(const aObject: TObject; const aClass: TClass; out ResObj): Boolean; overload;
    begin
      TObject(ResObj) := nil;
      if aObject is aClass then
      begin
        if not ((aObject is TBoldObject) and (aObject as TBoldObject).BoldObjectIsDeleted) then
          TObject(ResObj) := aObject;
    
      end;
      result := TObject(ResObj) <> nil;
    end;



    Example of usage
     

    var myInvoice: TInvoice;   // This inherit TBoldObject
    if Supports(myclass.somelink, TInvoice, myInvoice)
    begin
      // code that use myInvoice
    end;


     


  3. I try to use Unit Dependency Analyzer. The target is to cut compile time by find cyclic dependencies in a big project where Unit A use Unit B. And Unit B use Unit A.

    I have attached a screenshot. How do I read that ?

    I see for example that AttracsCustomsSpanFetch uses AttracsSystemsGlobals in Implementation section. I see nothing wrong with that.
    But AttracsSystemsGlobals use BusinessClasses in interface section. And BusinessClasses uses AttracsSystemsGlobals in implementation section.
    I marked it with red and green. So that is a cyclic dependency, right ?

     

    But the dialog show nothing that differ the two cases above.
    Or did I miss something ?

     

    CyclicDependencies.png


  4. Internally we didn't agree on that sentence. Anyway a new guy start next week and another one in August.

     

    Many complain that there is no jobs for Delphi. At the same time some employers leave Delphi as it is hard to find developers. It don't make sense for me 😊

    • Like 1

  5. Ok thanks for the feedback.

    So back to the original question 😊

    What is the best or most convenient path to connect and use Google Cloud logging from Delphi?

     

    I want to avoid dependencies to third-party components and dll-files if it is possible. But it is not a requirement.

     

    Roland 

     


  6. Ok I have never used https in Delphi.

    Just so I understand you correct.

    Delphi httpclient use openssl?

    No need to deploy additional dll with exe-file? 

    Where can I find an example of this?

    The application is deployed on Windows Server 2012

     

    Regards 

    Roland 


  7. I want to use Google Cloud logging from Delphi. From https://cloud.google.com/apis/docs/client-libraries-explained

     

    While you can use Google Cloud APIs by making direct HTTP requests to the server (or RPC calls where available), we provide client library code for all our Cloud APIs that makes it easier to access them from your favorite languages

     

    Of course Delphi is not represented.

    Any hints on how I can use cloud for logging?

    It also mention that https://www.fluentd.org can be used from any language. But I still want samples how to use all this in practice.

    Any help appreciated!

     


  8. I think I found some kind of conflict between TestInsight and MMX Explorer.

    I have installed Delphi 11 in a VmWare WorkStation VM.

    Installed TestInsight from https://files.spring4d.com/TestInsight/1.2.0.1/TestInsightSetup.zip
    Run installer and verified it works fine on a test-project
    Next install MMX Explorer from https://www.mmx-delphi.de/download/338/

    Now I run TestInsight on the testproject and it looks like this
    image.thumb.png.522fed3f56862fb585a59aa23a2d1091.png

     

    So it just show an empty window. No result from the tests.
    I have the same problem in Delphi 10.4.2.

    I like both plugins and want them to cooperate better.
    Anyone with similar experience ?

     

    Regards

    Roland Bengtsson


  9. Good that you manage to fix problem with Toolbar :classic_smile:
     

    Quote

    Just curious, can you elaborate how your are planning to use code coverage for almost the whole project at once? What information are you expecting to get from that?

    The big 5 mloc project also have a Testproject. I know only a fraction of code is executed in testproject.
    So I am curious how much. 0.1, 3 or 10 % of all code ?

    But I also understand now it is technically challenging to get a code coverage of whole project.

    Reading https://github.com/magicmonty/delphi-code-coverage/blob/master/CodeCoverage/BreakPoint.pas now
    It use opcode $CC Is it the same kind of breakpoint you use ?

    Could be there is no silverbullet to get full code coverage without major speed penalty :classic_smile:


     


  10. Yes the Toolbar is not working in Sydney. But can still use hotkey so no big deal.

     

    I have to manually mark each method to enable code coverage. Is it possible to just enable all code in a project for code coverage? My project have about 5 mloc with thousands of methods. It would be handy 😊


  11. 6 hours ago, Uwe Raabe said:

    Great, will try it now :classic_biggrin:

    [EDIT]
    I tried to clone the repo, compiled it and install.
    I got this error
     

    ---------------------------
    CodeCoverage - Delphi 10.4 - Welcome Page [Built]
    ---------------------------
    Registration procedure, Codecoverage@Main.Register in package C:\Attracs\DelphiCodeCoveragePlugin\Packages\Delphi 10.4 Sydney\CodeCoverage270.bpl raised exception class EAbstractError: Abstract Error.


     

    Any clue ?
     

    /Roland


  12. Attracs company in Finland looking for Delphi developer. Our main application do transport planning and logistics. The office is in Kokkola. Now, most work is done remotely but hopefully, COVID-19 will end someday. So we would prefer someone in the neighborhood.

    We use Delphi Sydney, Bold for Delphi and Windows. Currently, we are 4 developers plus 2 consultants.

     

    In case you are a senior Delphi developer you can also work remotely as freelancer.

    Experience of ORM or Bold for Delphi is a merit.

     

    Ask for more details.

    • Like 3

  13. I want to develop an own component for TCombobox. It should work like this:

     

    1. User type something in the field
    2. User type magic keys, in my case ",," to trigger the search for typed characters
    3. My event OnTrig is called. That search in SQL in the database for the characters. So this can be any tables in the database and is customized per instance of the component.
    4. The list of hits is displayed in the combobox. If too many the first 99 hits is displayed
    5. The user picks one of the hits in the combobox. Now the event OnPick is triggered. That is, of course, different per instance and transform the hit to an object in application.
    Now could you give some general advice about how I should proceed?

     

    I have bought Devexpress VCL components so have source for that. Maybe better to use any of those comboboxes as base?

     

    Regards 

    Roland Bengtsson 


  14. Yes, I corrected spelling. Anyway even if that guy is in charge of Delphi. I doubt he is reading this or other forums that people complaining about  how things are handled.
    I think it is better to try do something concrete about it.

    I made an empty document here https://docs.google.com/document/d/1uxa9u09hE7tLEMau1Ld9OELJoTCTvxEyst6JY3yevzo/edit?usp=sharing
    Anyone can add and edit the ideas.

     

    What changes do we want from Embarcadero ?

×