fpc 3.2.2 - CTOR to a Procedure problem lazarus / 21-General ---------------------------------------------------------------------- paule32 · 2025-06-06 18:08 hello - I have a class "TApplication" - in the CTOR, I do a call to the following procedure: 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 procedure TApplication_Create(p: TApplication);begin  {$ifdef DLLDEBUG}  writeln('TApplication: Create');  {$endif DLLDEBUG}    if not Assigned(p) then  begin    showMessage('11111 55555555');    Exit;  end;end;  when I call this member in CTOR with the "self" instance: 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 constructor TApplication.Create;begin  inherited Create;  TApplication_Create(self);end; I get a "not Assigned(p)" in code of "TApplication_Create" - but why ? - the instance is created per TApplication.Create ? ---------------------------------------------------------------------- ASerge · 2025-06-07 00:04 Quote from: paule32 on June 06, 2025, 08:08:17 pmI get a "not Assigned(p)" in code of "TApplication_Create" - but why ? The error is in the place that you did NOT show A simple example shows "OK". 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}{$IFDEF WINDOWS}  {$APPTYPE CONSOLE}{$ENDIF} type  TApplication = class(TObject)    procedure TApplication_Create(p: TApplication);  constructor Create;  end; procedure TApplication.TApplication_Create(p: TApplication);begin  if not Assigned(p) then    Writeln('ERROR')  else    Writeln('OK');end; constructor TApplication.Create;begin  inherited;  TApplication_Create(Self);end; var  Application: TApplication;begin  Application := TApplication.Create;  Application.Free;  Readln;end.