Jump to content

Uwe Raabe

Members
  • Content Count

    2904
  • Joined

  • Last visited

  • Days Won

    169

Posts posted by Uwe Raabe


  1. I cannot check this in my environment as I neither have a Personal Edition nor a Community Edition at hand. I can just share that my Architect Edition shows Enterprise in the details, which is expected because Enterprise and Architect differ only in the licenses for some external tools.

     

    Given the previous findings, the Product name seems to be a valid approach to detect the installed edition.


  2. If a unit is resolved by the -A option, any double occurrence is silently resolved, too. So, strictly speaking, the error is not suppressed in the sense of it is an error, but we don't show it, but rather internally resolved by removing the superfluous occurrences.

     

    In my blog article Conditional Uses Clause Considered Harmful one of the suggestions (Solutions 2) actually makes use of this behavior.


  3. 2 hours ago, Remy Lebeau said:

    The whole point of TImageCollection is to provide images of different sizes/resolutions, and then TVirtualImageList presents those images at a given size/resolution.

    It also scales the image if the requested size is not present.


  4. 5 hours ago, bazzer747 said:

    //Run the report
    fRepCompEnrolment.sctRepCustListt.Run;

    Let me guess: fRepCompEnrolment is a form containing a component named sctRepCustListt (not sure about the trailing doubled t, but I copied it) of type TSctReport?

    Then the file where fRepCompEnrolment is declared is the pas file you are looking for.

     

    It can still be that that .pas cannot be found and it works because the compiled .dcu is used instead, but that would be pretty uncommon for this case.


  5. Unless I misunderstand you completely, the .pas file have the same name as the .dfm file containing the form. 

     

    37 minutes ago, bazzer747 said:

    I might not be seeing the woods for the trees here

    Well, that might indeed be the case, but you might describe your situation in more detail to clarify.


  6. The code for checking the presence of a Delphi IDE is like this:

    function IsDelphiIDEInstalled(IDEVersion: TDelphiIDEVersion): Boolean;
    var
      R: TRegistry;
    begin
      R := TRegistry.Create;
      try
        R.RootKey := HKEY_LOCAL_MACHINE;
        Result := R.OpenKeyReadOnly(DelphiIDEKey(IDEVersion));
      finally
        R.Free;
      end;
    end;

    DelphiIDEKey evaluates to Software\Embarcadero\BDS\%d.0 for the newer versions. Note that ModelMaker is only aware of BDS versions up to 19.0 (Delphi 10.2 Tokyo). 

     

    You might get away with just creating the base key for a non-installed version to trick ModelMaker into looking for the expert. So adding HKLM\Software\Embarcadero\BDS\19.0 to the registry should get you going.


  7. Is this in HKEY_LOCAL_MACHINE?

     

    If yes, there might be other criteria being checked for existence of a Delphi version. I'm willing to investigate, but my possibilities in regard to ModelMaker are a bit limited compared to MMX.


  8. There are several bugs fixed in 12.2 and 12.3 affecting frames.

    https://quality.embarcadero.com/browse/RSP-37402

    https://quality.embarcadero.com/browse/RSP-39847

    https://quality.embarcadero.com/browse/RSP-40110

    https://quality.embarcadero.com/browse/RSP-43560

    https://embt.atlassian.net/servicedesk/customer/portal/1/RSS-1020

     

    Perhaps these will fix your problem, too.

     

    I will test your project later when I've found some time to configure my system for monitors with different dpi.

    • Like 2

  9. 2 hours ago, jesu said:

    Yes, Windows 11 Notepad screws files. This never happened in Windows 10 after many years using it. You open a file double-clicking it, edit it and just click save expecting that it respects your encoding. Sometimes it does, sometimes not. Sure, you can use Save as to be sure that it uses the encoding you want, but that was never neccessary before.

     

    23 hours ago, jesu said:

    Unfortunately, we still need to use ANSI in some files but sometimes (likely by notepad) that is replaced with UTF8.

    I just took what the OP wrote and show a way to revert any file somehow changed from ANSI to UTF-8. I never said it is a silver bullet for all circumstances.


  10. 5 minutes ago, jesu said:

    The fact is that we need to restore these files without loosing time doing it by hand.

    Load the file with UTF-8 encoding and save it with ANSI encoding.

    uses
      System.IOUtils;
      
    ...
      TFile.WriteAllText(FileName, TFile.ReadAllText(FileName, TEncoding.UTF8), TEncoding.ANSI);

    If the files are too large to fit into memory, you need to work with different file names for input and output:

      var writer := TStreamWriter.Create(NewFileName, False, TEncoding.ANSI);
      try
        var reader := TStreamReader.Create(FileName, TEncoding.UTF8);
        try
          while not reader.EndOfStream do
            writer.WriteLine(reader.ReadLine);
        finally
          reader.Free;
        end;
      finally
        writer.Free;
      end;

     

×