Jump to content

Lajos Juhász

Members
  • Content Count

    1073
  • Joined

  • Last visited

  • Days Won

    15

Posts posted by Lajos Juhász


  1. When in the release notes they write full installation it means uninstall and reinstall. On webinars more than once was a question why they request the uninstall steps why not just replace the files. The answer is that it's easier to test and less change to have an error. (It makes sense but a bit more work when you have to install a "patch" of 6GB).


  2. Here it is: https://blogs.embarcadero.com/available-today-the-cbuilder-and-rad-studio-11-1-5-c-code-insight-update/

     

    The relevant part is:

    Being tightly focused on C++, the 11.1.5 C++ Code Insight Update has no benefit for Delphi customers and we do not recommend Delphi customers to install it. Other than the C++ Code Insight changes, 11.1.5 is identical in features to 11.1. RAD Studio 11.1.5 is a full installation, and includes all hotfixes issued for 11.1.


  3. 39 minutes ago, PeterBelow said:

    for i := Low(CompanyDataBase) to High(CompanyDataBase) do

    As far as I remember this should be

     

    i:=0;

    SetLength(CompanyDataBase, FileSize(f))

    while not eof(f) do

    begin

      Read(f, CompanyDataBase);

      inc(i);

    end;

     

    Last time I wrote a code like this was in Pascal. (Btw. to be on the safe side you should also define the record as packed).


  4. 1 hour ago, Andy1234 said:

    Perhaps I misunderstand, but it seems to me that Xcode is needed only for exporting SDK. He does not take any part in the assembly.
    I made this conclusion from the fact that the current assembly is going well for me.

    The app is sent to Apple for review, but only SDK 14 fails:

    ERROR ITMS-90725: "SDK Version Issue. This app was built with the iOS 14.0 SDK. All iOS apps submitted to the App Store must be built with the iOS 15 SDK or later, included in Xcode 13 or later." (-18000)

     

    As far as I understood XCode is needed to sign the application (I don't touch those things as I develop only for Windows and just read about other platforms in case I must do some work on them).


  5. In this code snippet you don't have how you set up the connection and that's the error you got.

     

    My guess is that in your code somewhere the connection's ConnectionDefName property is set to C:\Prog2\employee.fdb instead of EMPLOYEE.

     

     


  6. 42 minutes ago, Fr0sT.Brutal said:

    Don't forget " Embarcadero Technologies does not currently have any additional information. "

     

    Especially true for roadmap and release plan. Like we don't have to plan our releases based on new versions of the Delphi (that can ship bug fixes).


  7. 2 hours ago, David Heffernan said:

    This should just work. The real question is why your modal message box is not on top. You should try to work that out.

    Yesterday with a Delphi 11 application I had a situation when a modal formed showed normally on top of the main form. Opened another application and when moved back to the first application the modal form was behind the main windows. It was not possible to move the modal form forward.

     

    When before calling showmodal set the  popupparent to be the main form the application behaved as should.


  8. The exact same is with Delphi 11. Tested with:

     

    procedure TForm1.FormCreate(Sender: TObject);
    var
      f: pointer;
    begin
      f:=0;
    end;
     

     

    [dcc32 Warning] Unit1.pas(29): W1013 Constant 0 converted to NIL

     

     

    Here is what helps says about this warning:

     

     

    The Delphi compiler now allows the constant 0 to be used in pointer expressions in place of NIL. This change was made to allow older code to still compile with changes which were made in the low-level RTL.

     

    program Produce;
    
      procedure p0(p : Pointer);
      begin
      end;
    
    begin
      p0(0);
    end.
    
    

    In this example, the procedure p0 is declared to take a Pointer parameter yet the constant 0 is passed. The compiler will perform the necessary conversions internally, changing 0 into NIL, so that the code will function properly.

     

    program Solve;
    
      procedure p0(p : Pointer);
      begin
      end;
    
    begin
      p0(NIL);
    end.
    
    

    There are two approaches to solving this problem. In the case above the constant 0 has been replaced with NIL. Alternatively the procedure definition could be changed so that the parameter type is of Integer type.


  9. 1 hour ago, McPain said:

    why a "insert into" when the DBgrid is permanently connected to the database?

    After you save the data to the file. Someone can edit the file or the original data in the database, thus the program should figure out how to merge back the data.

    • Like 1

  10. 21 minutes ago, David Heffernan said:

    Wrong solution. Right solution is to learn what you don't know how to do. No shortcut. Certainly not by just saying "use interfaces". 

    My first suggestion was and still is to learn how to write a correct code. Interface is much better than constantly using FreeAndNil as band-aid solution.

     

    For example free and nil will not save you here:

     

    var

      x1, x2: TMyClass;

     

    begin

      x1:=TMyclass.create;

      .....

      x2:=x1;

      ......

      FreeAndNil(x1);

     

      x2.SaveTheWorldAndMakeItABetterPlace;

    end;

    Here maybe you will think you have an excellent code as there is FreeAndNil, however that will not help and x2 is still a stale reference.

     


  11. 21 minutes ago, stijnsanders said:

    Let me know if this hits the mark or is way off...

    var
      a:TThing;
    begin
      a:=nil;//counter warning (I)
      try
        if //only in some cases
        begin
          a:=TThing.Create;
          //...
        end;
        //...
        if a<>nil then
        begin
          //use a for something
        end;
        //...
      finally
        if a<>nil then (II)
        begin
          a.Free;
          a:=nil;
        end;
      end;
    end;

    (I) Wrong comment. a is a local variable and doesn't have to be nil. Thus the nil is required to signal that there is no object assigned to variable a.

    (II) In this code a is nil or a valid reference thus it's not required to check if it's nil that will be done in the free method.  In the next line it's not required to assign nil to a. A is a local variable and finally after the finally it will go out of scope.


  12. 10 minutes ago, Der schöne Günther said:

    If that is all, how can you even have an opinion on that? What is there to talk about? Can somebody get me up to date with just one or two sentences?

     

    My guess is that they'll try to proove that you can use free instead of freeandnil. Often you can find code:

     

    var

      X: TMyImportantForm;

     

    begin

       x:=TMyImportantForm.create(self);

       try

         ... some boring code ....

       finally

          FreeAndNil(x);

       end;

    end;

×