Forward declaration of procedural types lazarus / 21-General ---------------------------------------------------------------------- MarkMLl · 2022-11-16 13:43 I know that there's a correct way of doing this, but I don't know the correct reference terms for which I apologise in advance. Given code that looks like 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  ScpiProc= procedure(scpi: TScpiServer; const command: AnsiString);   TScpiServer= class(TThread)...    procedure RegisterProc(const pattern: AnsiString; proc: ScpiProc);...  end;  procedure scpiDoNothing(scpi: TScpiServer; const {%H-}command: AnsiString); beginend { scpiDoNothing } ;   That obviously won't compile, since I'm referring to TScpiServer before its definition. I really don't want to have to put the implementation of the procedure in a derived type or a class helper, since there's likely to be a lot of these spread over many units. Is there a reasonably neat way of handling the forward declaration? MarkMLl ---------------------------------------------------------------------- marcov · 2022-11-16 13:51 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  TScpiServer = class;  ScpiProc= procedure(scpi: TScpiServer; const command: AnsiString);   TScpiServer= class(TThread)...    procedure RegisterProc(const pattern: AnsiString; proc: ScpiProc);...  end;  procedure scpiDoNothing(scpi: TScpiServer; const {%H-}command: AnsiString); beginend { scpi Probably needs to be inside the same TYPE block. ---------------------------------------------------------------------- MarkMLl · 2022-11-16 13:55 That's it, thanks very much :-) MarkMLl