Bug - misplaced end; lazarus / 9-Editor ---------------------------------------------------------------------- Birger52 · 2020-06-13 16:12 I often put code for a given object in .inc files, and indclude the file where it is needed. Adding a procedure or function at the end of the include file, triggers an odd behavior: The "end;" that is (sometimes) atomagically added to the typed coding, is placed after the Code: [Select]{$I myinclude.inc} where the inc is included, and not in the actual file edited....: Code: [Select]{$I myinclude.inc}end;This leads to a Code: [Select]*.pas(118,23) Fatal: Syntax error, "." expected but ";" founderror ---------------------------------------------------------------------- Bart · 2020-06-13 16:24 This a known bug, IIRC it is somewhere in the bugtracker. Bart ---------------------------------------------------------------------- Blaazen · 2020-06-13 16:31 I can reproduce and I observed what happens. Solution is to NOT write to the latest line of include file. 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 zzz;begin|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 zzz;begin| The first case will add end; to the main file like that: 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 {$I umaindesign.inc}end;The second case adds it correctly: 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 zzz;begin end;You can do a bugreport about it. I don't mind since I always put two empty lines at the end of any *.pas or *.inc file and I didn't face this bug (until you told me about). EDIT:  Bart says it is already reported.