fpc 3.2.2 - Forward a Class - how to ? lazarus / 21-General ---------------------------------------------------------------------- paule32 · 2025-06-06 11:06 hello, how can I "forward" a class ? given two classes: type TBar = class;  // this give me: Error: forward declaration of                             // class "TBar" must be resolved here type TFoo = class(TBar)        public            procedure setAHandle(AHandle: Integer);        end; type TBar = class(TBaz)        private          AHandle: Integer;        end; ---------------------------------------------------------------------- Awkward · 2025-06-06 11:13 You must define forward class in same "type" block ---------------------------------------------------------------------- paule32 · 2025-06-06 11:21 following Code produce the Compiler Error: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i type  TPersistent = class(TObject)  public    constructor Create;    destructor Destroy; override;        class function ClassName: String; stdcall; virtual;  end; type TComponent = class;  TControl = class(TComponent)  private    FAlign: TAlign;    FClientHeight: Integer;    FClientWidth: Integer;    FHeight: Integer;    FLeft: Integer;    FTop: Integer;    FWidth: Integer;  protected    function GetClientHeight: Integer;    function GetClientWidth: Integer;        procedure SetClientHeight(AValue: Integer);    procedure SetClientWidth (AValue: Integer);        procedure SetAlign(AValue: TAlign);  public    constructor Create(AOwner: TComponent);    destructor Destroy; override;        class function ClassName: String; stdcall; virtual;  published    property Align: TAlign read FAlign write SetAlign default alNone;    property Height: Integer read FHeight write FHeight;    property Left: Integer read FLeft write FLeft;    property Top: Integer read FTop write FTop;    property Width: Integer read FWidth write FWidth;  end;   TComponent = class(TPersistent)  private    FArray: array of TComponent;    FOwner: TComponent;    FIndex: Integer;    FTag: NativeInt;  protected    function  GetComponent(I: Integer): TComponent;    function  GetComponentCount: Integer;    function  GetComponentIndex: Integer;    function  GetComponentOwner: TComponent;        procedure SetComponentIndex(AValue: Integer);    procedure SetComponentOwner(AOwner: TComponent);  public    constructor Create(AOwner: TComponent); virtual;    destructor Destroy; override;        class function ClassName: String; stdcall; virtual;  published  property ComponentCount: Integer read GetComponentCount;    property ComponentIndex: Integer read GetComponentIndex write SetComponentIndex;    property Components[I: Integer]: TComponent read GetComponent;    property Owner: TComponent read FOwner;    property Tag: NativeInt read FTag write FTag default 0;  end; ---------------------------------------------------------------------- Zvoni · 2025-06-06 11:29 Quotetype TComponent = class;   TControl = class(TComponent)   private     FAlign: TAlign; ---------------------------------------------------------------------- paule32 · 2025-06-06 15:07 ok, thank you. it works like a charm.