Gui Elements can't be found in procedure lazarus / 31-LCL ---------------------------------------------------------------------- SimoneD · 2021-01-18 14:58 Hi, I am coding sorting algorithms for school. There is some output code that repeats itself for every sortingalgorithm SortierteArrayGui is a TMemo DauerGui is a TLabel 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 TForm1.GnomesortGuiClick(Sender: TObject);var i:integer; zwischenspeicher:string;begin   TicksBefore:=GetTickCount;   SortierteArray:= AlgorithmusGnomesort(1, Anzahl, UnsortierteArray);   //repeating output;   zwischenspeicher:= '';   SortierteArrayGui.Lines.Clear;   for i:= 1 to Anzahl do   begin       zwischenspeicher := zwischenspeicher + IntToStr(SortierteArray[i])+ '; ';   end;   SortierteArrayGui.Text := zwischenspeicher;   DauerGui.Caption := IntToStr(GetTickCount - TicksBefore);   //output endend;             Everything works fine this way, so i decided to relocate it into folowing 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 Ausgabe;                                                                 var                                                                                  i:integer;  zwischenspeicher:string;begin   zwischenspeicher:= '';   SortierteArrayGui.Lines.Clear;   for i:= 1 to Anzahl do   begin       zwischenspeicher := zwischenspeicher + IntToStr(SortierteArray[i])+ '; ';   end;   SortierteArrayGui.Text := zwischenspeicher;   DauerGui.Caption := IntToStr(GetTickCount - TicksBefore);end; When running the program I get this error. Identifier not found "SortierteArrayGui" Identifier not found "SortierteArrayGui" Identifier not found "DauerGui" The code works without relocating the code but its very ugly to repeat the exact same code for several times. Thanks for any help, sorry if this isn't the right place to post this question. ---------------------------------------------------------------------- lainz · 2021-01-18 15:31 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 Ausgabe; it must be 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 TForm1.Ausgabe; And you must add 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 Ausgabe; in the interface of the form. ---------------------------------------------------------------------- SimoneD · 2021-01-18 15:48 Thank you very much! That fixed it