Using TFPGObjectList lazarus / 61-Beginners ---------------------------------------------------------------------- caliguy · 2021-08-12 19:22 Hi,     I am new to Pascal programming. I am trying to use TFPGObjectList and getting compliation error. Any help is apprciated. Here's my code. Thanks 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 {$mode objfpc}interface uses  FGL, DB, SysUtils, uGlobalVarLcl,ucommondb,uAppLcl, strutils ; {$M+}       type  TUser = class  private    Fscode        : string;                 Fsfirstname : string;                 Fslastname    : string;              published    property scode        :string       read  Fscode          write Fscode        ;    property sfirstname   :string       read  Fsfirstname     write Fsfirstname   ;    property slastname    :string       read  Fslastname      write Fslastname    ;    constructor Create();     function GetUser(usercode:string):TUser;    //function GetUserList():TUserList; ==> Getting compilation error here end;   TUserList = specialize TFPGObjectList; implementation  {TUser}               constructor TUser.Create(); begin    self.scode        :=  '' ;    self.sfirstname   :=  '' ;    self.slastname    :=  '' ; end; function TUser.GetUser(usercode:string):TUser; var local:Tuser; begin  ..     Result := local; end; //function GetUserList():TUserList;//var usrlist:TUserList;// begin//  ..      //  Result := usrlist;// end; ---------------------------------------------------------------------- howardpc · 2021-08-12 19:32 Try this: 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   TUser = class; // forward declaration   TUserList = specialize TFPGObjectList;   TUser = class(TObject)  private    Fscode      : string;    Fsfirstname   : string;    Fslastname    : string;  published    property scode        :string       read  Fscode          write Fscode        ;    property sfirstname   :string       read  Fsfirstname     write Fsfirstname   ;    property slastname    :string       read  Fslastname      write Fslastname    ;    constructor Create();    function GetUser(usercode:string):TUser;    function GetUserList(): TUserList; end; implementation constructor TUser.Create(); begin    self.scode        :=  '' ;    self.sfirstname   :=  '' ;    self.slastname    :=  '' ; end; function TUser.GetUser(usercode:string):TUser;var  local: Tuser = Nil;begin  Result := local;end; function TUser.GetUserList():TUserList;var  usrlist: TUserList = Nil;begin  Result := usrlist;end; ---------------------------------------------------------------------- caliguy · 2021-08-12 22:18 okay. Thank you for quick response