Bug? Variant incompatibility with shortstring lazarus / 1-Linux ---------------------------------------------------------------------- anthony · 2008-09-09 14:53 Hello, Is this a bug? Code: [Select] {$mode delphi} Edited. Sorry wrong example -- see below ---------------------------------------------------------------------- Phil · 2008-09-09 15:54 Quote from: "anthony"Hello, Is this a bug? Code: [Select] {$mode delphi} Var SS : String [80];        S   : String;        V  : Variant; S := V.AsString;            // OK SS := V.AsString;           // Lazarus : Error     Delphi : OK SS := S;                   // OK I get a runtime error with Delphi from your code. Thanks. -Phil ---------------------------------------------------------------------- anthony · 2008-09-09 20:34 Sorry, wrong example. This is the correct example: Code: [Select] Procedure Tform1.Button1click(Sender: Tobject); Var     V       : Variant;         SS      : String [80];         S       : String; Begin    V  := 'Hello';    S  := V;    Caption := S;                    // Lazarus OK,    Delphi OK    SS := V;    Button1.Caption := SS;           // Lazarus Error, Delphi OK End; ---------------------------------------------------------------------- Phil · 2008-09-09 22:01 Quote from: "anthony"Sorry, wrong example. This is the correct example: Code: [Select] Procedure Tform1.Button1click(Sender: Tobject); Var     V       : Variant;         SS      : String [80];         S       : String; Begin    V  := 'Hello';    S  := V;    Caption := S;                    // Lazarus OK,    Delphi OK    SS := V;    Button1.Caption := SS;           // Lazarus Error, Delphi OK End; It looks like the FPC compiler just doesn't allow the assignment of a Variant that contains a string to a short string. Click Bug Tracking on the left and click the FPC link, then post this as a bug. Thanks. -Phil