Error: in front of code lazarus / 12-Debugger ---------------------------------------------------------------------- Eugene Loza · 2017-08-03 11:05 I get "Error: in front of code" error each time I try to type comments before the actual unit... Is it correct? It's just a comment on the unit purpose for pasdoc, I don't write any code there... Lazarus 1.8.0RC3 + FPC3.0.3 Debian Jessie 64 bit ---------------------------------------------------------------------- Thaddy · 2017-08-03 11:10 *Before* either unit or program or library, only comments are allowed. Not plain text. Your screenshot hides the beginning.... I suspect you are trying to include something before the comment. Show us the beginning of your unit.... or program....or library ---------------------------------------------------------------------- Eugene Loza · 2017-08-03 11:20 Quote from: Thaddy on August 03, 2017, 01:10:52 pmI suspect you are trying to include something before the comment. Show us the beginning of your unit.... or program....or libraryNope, nothing in front. Just a GPLv3 statement and comments. Here's the full code: https://github.com/eugeneloza/decoherence/blob/m aster/decocreatures.pas UPD: I've attached the unit, as I've removed it from the project (due to wrong architecture). It's not the only unit which features this "error", I experienced it a few times recently. Looks like it started showing up with 1.8.0RC3 because I've never seen anything like that before. P.S. The error doesn't persist and shows only after I paste the GPLv3 statement in the code and start editing the unit's comment. It doesn't prevent from successfully compiling the whole project. Neither it shows up after I've compiled everything (later editing the comment doesn't show any error). ---------------------------------------------------------------------- Thaddy · 2017-08-03 13:45 Well, it complains about the include file, so what do you mean? If I can't examine that I can not debug the code..... I suspect, though, you have to put it in the interface section, not before it... ---------------------------------------------------------------------- Eugene Loza · 2017-08-03 13:59 QuoteIf I can't examine that I can not debug the code.....of course ... in order to compile the actual code you have to download all the project (~50 units) and properly install CastleGameEngine. And as I've written it fires only once, after pasting the GPLv3 statement (and not always). I couldn't reproduce the error on a "clean" project, neither in "what is exact sequence of actions causing this" (it happened several times, just now I've made a few test units and it didn't show any error). QuoteI suspect, though, you have to put it in the interface section, not before it...hmm... I just replace {$mode objfpc}{$H+} with my include (which includes this string). Nothing special, just some compiler config https://github.com/eugenelo za/decoherence/blob/master/compilerconfig.inc ---------------------------------------------------------------------- Thaddy · 2017-08-03 14:20 The unit simply compiles with the include (and excluding uses CastleCreatures and irrelevant change DCreature = class (Tobject) ). I guess it is solved? ---------------------------------------------------------------------- Eugene Loza · 2017-08-03 14:31 Quote from: Thaddy on August 03, 2017, 04:20:41 pmI guess it is solved?Nope.  I've written above the unit compiles EVEN when there is an error shown. There's absolutely no other problem. Just an error shown there. Nothing more. ---------------------------------------------------------------------- Eugene Loza · 2017-08-03 14:34 I've found an exact sequence to reproduce the error. 1. File>New>Application 2. Make a comment block above unit1. 3. Start typing a comment and use generic FPC operators/expressions. ANY valid operator like "WriteLn(" would result in showing this error. ---------------------------------------------------------------------- Ondrej Pokorny · 2017-08-03 15:04 Quote from: Eugene Loza on August 03, 2017, 04:34:09 pmI've found an exact sequence to reproduce the error. 1. File>New>Application 2. Make a comment block above unit1. 3. Start typing a comment and use generic FPC operators/expressions. ANY valid operator like "WriteLn(" would result in showing this error. Great, please report to mantis. ---------------------------------------------------------------------- Eugene Loza · 2017-08-03 15:19 Quote from: Ondrej Pokorny on August 03, 2017, 05:04:02 pmGreat, please report to mantis.I'm afraid I'm too inexperienced programmer to do that... I've tried a few times, and the response was always similar to "It's a feature, not a bug. If you don't know something, post in the forum, not on bugtracker". Actually I cannot disagree with my lack of deep knowledge of FPC, so I've decided to leave bugreports to more experienced users. I can't be sure if this is really a bug in IDE or FPC (not a bug of my understanding/expectations) and worth attention of developers. If someone with better understanding of freepascal and bugtracker policy believes it's a bug, I'd be very thankful for filling in the bugreport for this issue, the information and the screenshot provided in my previous message should be enough. Thou, again, I'm not experienced enough to be sure if its a bug. ---------------------------------------------------------------------- Bart · 2017-08-03 16:08 Reported a issue #32235. Bart ---------------------------------------------------------------------- Eugene Loza · 2017-08-03 16:13 Quote from: Bart on August 03, 2017, 06:08:54 pmReported a issue #32235. Bart Thanks a lot! ---------------------------------------------------------------------- Thaddy · 2017-08-03 18:43 So, for now disable codetools. That's why I did not get an error..... ---------------------------------------------------------------------- Martin_fr · 2017-08-03 22:24 When it happens next time: Do this for the 1) active unit in Source Edit 2) the unit that is mentioned in the error (switch tab to the error unit) For each go to menu "View" > "Ide internals" > "show codetools nodeinfo" Copy the info of all 3 tabs, and attach to the bug report. ---------------------------------------------------------------------- Bart · 2017-08-04 07:33 Quote from: Martin_fr on August 04, 2017, 12:24:03 amFor each go to menu "View" > "Ide internals" > "show codetools nodeinfo" There is no such menu entry in my IDE (trunk). The "IDE Internals" menu shows 3 submenu's: - About FPC - About IDE - What needs buiding Bart ---------------------------------------------------------------------- Eugene Loza · 2017-08-04 07:49 Yes, the same here. Lazarus 1.8.0RC3 (re-built in debug mode, no luck). ---------------------------------------------------------------------- howardpc · 2017-08-04 08:00 The option is there in 1.8.0RC2. Not sure at what point in the development cycle it dropped out. ---------------------------------------------------------------------- JuhaManninen · 2017-08-04 10:15 It is part of the Cody package which is not installed by default. ---------------------------------------------------------------------- Eugene Loza · 2017-08-04 11:01 JuhaManninen, yes, it's working this way! (attached here and to the bug report)