Jump to content

Stéphane Wierzbicki

Members
  • Content Count

    233
  • Joined

  • Last visited

Posts posted by Stéphane Wierzbicki


  1. 3 minutes ago, Stefan Glienke said:

    I read your post three times but I could not make any sense of it.

     

    What does "BPL are screwed" mean? And what does "bpl output" mean? The binary size of the bpl? So when using the class helper the binary is smaller than when not using it?

    What class helper? Provide more information and be less sketchy.

    You are right....

    It's my mind who was screwed....

     

    Sorry but I found my mistake. I'm working with JVCL Plugin manager and I've created a bunch of plugins (packages). I forgot to update interfaces where I used the same GUID...

    Some of my packages where (badly) configure with GUI units (thus the output bpl size was bigger)

     

    Sorry for this bad topic !


  2. 2 hours ago, Attila Kovacs said:

    Reading your question I don't really know what you need

    I need a component or a library that allows me to connect to a sFTP server. 

     

    I will check links you and @WillH posted.


  3. Hello, 

     

    Does Indy support SSH? I need to connect to an SFTP server. I don't need SFTP (FTP over SSH) as it is different than FTPS (FTP over SSL/TLS).

     

    If so, is there simple example available? 

    If not, is there any free library available? 

     

    Thank you! 


  4. Hello,

     

    Does anyone know how to store a TFDMemtable with its indexes?

     

    TFDMemtable.SaveToFile does not save indexes, I tried different formats ( sfXM,sfBinary,sfJSON).

    I've also tried to either add indexes with TFDMemtable.IndexDefs or with TFDMemtable.Indexes

     

    StoreItems is set to [siData, siDelta, siMeta].

     

    I'm clueless. Any idea?

     

     


  5. Hello,

     

    Anyone knows how I can delete an archive Item using TZipFile class ? 

    I found a TZipFileHelper class helper on the net. It is useless since we cannot access TZipFile private members anymore.

     

    procedure TZipFileHelper.Delete(FileName: string);
    var
      i, j: Integer;
      StartOffset, EndOffset, Size: UInt32;
      Header: TZipHeader;
      Buf: TBytes;
    begin
      i := IndexOf(FileName);
      if i <> -1 then begin
        // Find extents for existing file in the file stream
        StartOffset := Self.FFiles[i].LocalHeaderOffset;
        EndOffset := Self.FEndFileData;
        for j := 0 to Self.FFiles.Count - 1 do begin
          if (Self.FFiles[j].LocalHeaderOffset > StartOffset) and
             (Self.FFiles[j].LocalHeaderOffset <= EndOffset) then
            EndOffset := Self.FFiles[j].LocalHeaderOffset;
        end;
        Size := EndOffset - StartOffset;
        // Update central directory header data
        Self.FFiles.Delete(i);
        for j := 0 to Self.FFiles.Count - 1 do begin
          Header := Self.FFiles[j];
          if Header.LocalHeaderOffset > StartOffset then begin
            Header.LocalHeaderOffset := Header.LocalHeaderOffset - Size;
            Self.FFiles[j] := Header;
          end;
        end;
        // Remove existing file stream
        SetLength(Buf, Self.FEndFileData - EndOffset);
        Self.FStream.Position := EndOffset;
        if Length(Buf) > 0 then
          Self.FStream.Read(Buf[0], Length(Buf));
        Self.FStream.Size := StartOffset;
        if Length(Buf) > 0 then
          Self.FStream.Write(Buf[0], Length(Buf));
        Self.FEndFileData := Self.FStream.Position;
      end;
    end;

     

     

    ps: I'm using Delphi RIO


  6. 1 hour ago, Stefan Glienke said:

    How can a name collision between TTMSLoggerLogLevel.Exception and Sytem.SysUtils.Exceptions be an IDEFixPack issue?

    It has even been reported already: https://www.tmssoftware.com/site/forum/forum_posts.asp?TID=8402&amp;title=enumeration-names

    As written in my second post, the compiler error was caused by a name collision. Maybe my post was too confusing....

    "Building changed files" bug still persist until I remove IDE FixPack.  

     


  7.  

    Hi,

     

    I cannot get this procedure TPerson.LoadSettings(const aJsonString: String). Is there any reason why self instance is not updated with new value ?

     

    Is their any workaround or should I create a LoadSettings method outside TPerson ?

     

    program Project1;
    {$APPTYPE CONSOLE}
    {$R *.res}
    
    uses
      System.SysUtils,
      REST.JSON,
      Unit1 in 'Unit1.pas';
    
    var Person:TPerson;
        jsonstr:string;
    begin
      try
        Person:=TPerson.Create;
        try
           person.Name := 'Hello';
           jsonstr:=  Person.SaveSettings;
           writeln(jsonstr); //write {"name":"hello"}
           person.Name := 'hi';
           Person.LoadSettings(jsonstr);
           writeln(person.Name);    //write hi instead of Hello
           readln;
        finally
          Person.Free;
        end;
      except
        on E: Exception do
          Writeln(E.ClassName, ': ', E.Message);
      end;
    end.

     

    unit Unit1;
    
    interface
    
    type
      TPerson = class(TObject)
    
      private
        FName: string;
      public
        procedure LoadSettings(const aJsonString: String);
        function SaveSettings: string;
        property Name: string read FName write FName;
      end;
    
    implementation
    
    uses REST.JSON;
    
    procedure TPerson.LoadSettings(const aJsonString: String);
    begin
      self := TJSon.JsonToObject<TPerson>(aJsonString);
    end;
    
    function TPerson.SaveSettings: string;
    begin
      result := TJSon.ObjectToJsonString(self);
    end;
    
    end.

    Ps: I'm using Delphi RIO Updt 2


  8. Hi,

     

    I'm worried with latest Rad Studio 10.3.2 version. I have applied  Building Changed Files Patch but my modified pascal files (not saved) are no more taken on compiltion

     

    More, I'm suddenly getting weird erros that prevent me building my project... :

     

    [dcc32 Error] ETL.pas(360): E2005 'Exception' is not a type identifier on exception blocks...

    image.thumb.png.03b446c622001e246eb0f7dd8be0a956.png

     

    or

     

    [dcc32 Error] ETL.pas(450): E2029 '.' expected but ';' found

    image.thumb.png.ae5ea3c4f5c2bdd3812e2c02b3c4ada7.png

     

    Am I the only one suffering from this?

     

    Regards

     

     

     

×