Lazarus

Free Pascal => Beginners => Topic started by: Dennis1 on July 22, 2019, 06:35:17 pm

Title: What Just Happened?
Post by: Dennis1 on July 22, 2019, 06:35:17 pm
I'm working on a simple text editor as I learn Lazarus and Free Pascal. It's been going well. I usually get no errors when I compile -- generally just when I make a typo. But suddenly every control is not recognized and I have over 50 "identifier not found" errors. This was after making one tiny change to a menu caption, which I have since reversed. :o I've checked the "uses" section and nothing has changed. I've tried restarting etc. Nothing.

Any ideas??
Title: Re: What Just Happened?
Post by: winni on July 22, 2019, 06:45:15 pm
typo in

Code: Pascal  [Select]
  1.  TForm1 = class (Tform)

?????

Or the string in your menu caption not closed???

Or, or, or ...

Winni
Title: Re: What Just Happened?
Post by: wp on July 22, 2019, 06:47:56 pm
It's hard to tell without seeing any code... Please pack your source code (*.pas, *.lfm, *.lpi, *.lpr) files (plus any special data files if needed) into a common zip which you can upload under "Attachment and other options". Do not add compiler-generated file such as the exe, ppu, .o etc because this will make the upload to big.
Title: Re: What Just Happened?
Post by: Thaddy on July 22, 2019, 06:53:12 pm
Did you make that change in the lfm file? (usually  a NONO) Or in code?
Title: Re: What Just Happened?
Post by: Dennis1 on July 23, 2019, 04:46:05 am
I think fixed it. I replaced the header section from a backup and deleted all the menu entries. That removed the avalanche of errors. The only oddity remaining is that the font selection dialogue loads only intermittently. Still, progress!

Thank you to all who responded!
Title: Re: What Just Happened?
Post by: Dennis1 on July 23, 2019, 03:18:32 pm
After some trial and error to reproduce the problem, I've found that Lazarus seems to intermittently "forget" its forms or controls.

Say I'm changing the width of a Memo box. I type "Memo1." and after the "." the IDE produces a list of relevant methods etc. But only sometimes. Sometimes it has no idea what Memo1 is. Other times I have to type Form1.Memo1 before it remembers. Similarly, a simple line like "Form2.Show" works about half the time when compiled. 

It's probably something I'm doing, but what? 
Title: Re: What Just Happened?
Post by: Handoko on July 23, 2019, 03:57:56 pm
I never have the issue as you mentioned.

Please provide more information: your OS and Lazarus version, the steps to reproduce. And it's even better if you can provide the sample project.
Title: Re: What Just Happened?
Post by: wp on July 23, 2019, 04:08:48 pm
I never have the issue as you mentioned.

Please provide more information: your OS and Lazarus version, the steps to reproduce. And it's even better if you can provide the sample project.
I absolutely agree. Since you are a beginner, the same issue may happen again, and since you did not solve it in a way such that you know what you did, you will get into trouble again. Guaranteed!
Title: Re: What Just Happened?
Post by: Thaddy on July 23, 2019, 07:03:24 pm
Yup.
Title: Re: What Just Happened?
Post by: Dennis1 on August 15, 2019, 04:07:22 am
I agree!

I've reproduced the error twice. On both occasions, it happened after editing a menu caption and then double-clicking the resulting menu item and populating a new procedure. In both cases, every control on the form instantly became unknown and generated 50 errors. In both cases, it was fixed by shutting down and restarting (ie rebooting, not restarting Lazarus).
Title: Re: What Just Happened?
Post by: trev on August 15, 2019, 06:16:31 am
You till haven't said what operating system you are using and what version of Lazarus you are using.

I've not had the problem you describe in a project with many memos with macOS 14.6, FreeBSD 12 or Ubuntu v18.04, nor with Lazarus v2.0.0 or v2.1.0.
Title: Re: What Just Happened?
Post by: Dennis1 on August 17, 2019, 09:27:06 pm
Sorry -- it's Win7, Laz 2.0.2 r60954

I'm sure it's something I'm doing. I recompiled Lazarus to include the DCPCiphers and DCPHashes modules ... maybe I screwed something up.