Recent

Author Topic: Compiler renamed my classes and all procedures  (Read 9815 times)

JLWest

  • Hero Member
  • *****
  • Posts: 1293
Compiler renamed my classes and all procedures
« on: April 03, 2018, 02:50:29 am »
Changed Type From TForm2 : class(TForm)    to  TlblHdrInfoType = class(TForm)

It happened while I was  adding form labels in a procedure.
I compiled and it threw an error.

Compile Project, Target: PryDotDat.exe: Exit code 1, Errors: 10
uparser.pas(105,11) Error: Identifier not found "TForm2"
uparser.pas(105,11) Error: class identifier expected
uparser.pas(113,19) Error: Identifier not found "lblHdrInfoELEV"
uparser.pas(113,45) Error: Identifier not found "R"
uparser.pas(114,19) Error: Identifier not found "lblHdrInfoELEV"
uparser.pas(118,20) Error: Identifier not found "lblHdrInfoICAO"
uparser.pas(118,46) Error: Identifier not found "R"
uparser.pas(119,20) Error: Identifier not found "lblHdrInfoICAO"
uparser.pas(123,21) Error: Identifier not found "lblHdrInfoAirport"
uparser.pas(124,21) Error: Identifier not found "lblHdrInfoAirport"

I'm sitting where the error showd.

Can someone advise what I need to do.

Is it something I'm doing or a bug in the compiler?
 
FPC 3.2.0, Lazarus IDE v2.0.4
 Windows 10 Pro 32-GB
 Intel i7 770K CPU 4.2GHz 32702MB Ram
GeForce GTX 1080 Graphics - 8 Gig
4.1 TB

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Compiler renamed my classes and all procedures
« Reply #1 on: April 03, 2018, 03:09:21 am »
and now you are trolling us. 1) there is no compiler bug period. 2) please provide a video showing your complete process of renaming controls that creates the problem. there is no way the IDE and compiler are that unstable its more likely you are doing it wrong. If I had to guess I would say stop renaming controls outside the object inspector but luckily I don't. 
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

JLWest

  • Hero Member
  • *****
  • Posts: 1293
Re: Compiler renamed my classes and all procedures
« Reply #2 on: April 03, 2018, 03:31:04 am »
1. I'm not trolling you. (com on that was a low shot).
2. I changed my naming process. Everything is named at least 3 characters.
3. I don't rename outside of the object inspector.
4. if I spell a label wrong I usually copy from the Object Inspector and paste to the editor.
6. This time I just quit the program without saving or changing anything.
7. That's as close to a video as I get.

I don't know of anyone who sits with a video camera filming them self writing code.

I copied the project to another directory and fixed all the labels and type definations.

But when I compile the debugger throws an error;

You sound irate. This is the fourth time I have gone thru this process and I'm getting pretty sick of this.

I do have better things to do that Troll on the form or any form.
FPC 3.2.0, Lazarus IDE v2.0.4
 Windows 10 Pro 32-GB
 Intel i7 770K CPU 4.2GHz 32702MB Ram
GeForce GTX 1080 Graphics - 8 Gig
4.1 TB

lainz

  • Hero Member
  • *****
  • Posts: 4473
    • https://lainz.github.io/
Re: Compiler renamed my classes and all procedures
« Reply #3 on: April 03, 2018, 03:33:41 am »
You use git or SVN?

If not, please do and your problems will slowly go away.

JLWest

  • Hero Member
  • *****
  • Posts: 1293
Re: Compiler renamed my classes and all procedures
« Reply #4 on: April 03, 2018, 04:00:22 am »
You use git or SVN?

If not, please do and your problems will slowly go away.

Don't have a clue what you are talking about.
FPC 3.2.0, Lazarus IDE v2.0.4
 Windows 10 Pro 32-GB
 Intel i7 770K CPU 4.2GHz 32702MB Ram
GeForce GTX 1080 Graphics - 8 Gig
4.1 TB

lainz

  • Hero Member
  • *****
  • Posts: 4473
    • https://lainz.github.io/
Re: Compiler renamed my classes and all procedures
« Reply #5 on: April 03, 2018, 04:03:11 am »
You use git or SVN?

If not, please do and your problems will slowly go away.

Don't have a clue what you are talking about.

Google it. If you don't know or work with that no one can help you.

Is the way to work and revert back the bad changes in code.

Learn and then get back here.

JLWest

  • Hero Member
  • *****
  • Posts: 1293
Re: Compiler renamed my classes and all procedures
« Reply #6 on: April 03, 2018, 04:15:47 am »
lainz

You could have accomplished the same thing by simply saying Google whatever but then you would miss the opportunity to be sarcastic.

Getting the version widget dosn't help me with my current problem.

It's is a "Beginners" form. That means when people such as myself post they are trying to learn Free Pascal and Lazarus, not sarcasm.



 
FPC 3.2.0, Lazarus IDE v2.0.4
 Windows 10 Pro 32-GB
 Intel i7 770K CPU 4.2GHz 32702MB Ram
GeForce GTX 1080 Graphics - 8 Gig
4.1 TB

lainz

  • Hero Member
  • *****
  • Posts: 4473
    • https://lainz.github.io/
Re: Compiler renamed my classes and all procedures
« Reply #7 on: April 03, 2018, 04:27:49 am »
lainz

You could have accomplished the same thing by simply saying Google whatever but then you would miss the opportunity to be sarcastic.

Getting the version widget dosn't help me with my current problem.

It's is a "Beginners" form. That means when people such as myself post they are trying to learn Free Pascal and Lazarus, not sarcasm.

Read again. I'm not sarcastic.

Learn GIT or SVN. Is clear?

Is a thing a newby should learn. That way if compiler or ide or you do something can be reverted to a working state.

Else you always will come to the original problem.

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Compiler renamed my classes and all procedures
« Reply #8 on: April 03, 2018, 04:51:02 am »
1. I'm not trolling you. (com on that was a low shot).
probably a cheap shot, but steel, it fills like trolling to me.
2. I changed my naming process. Everything is named at least 3 characters.
positive action.
3. I don't rename outside of the object inspector.
well I have no idea what to say except, it never happens to me, is that more helpfull?
4. if I spell a label wrong I usually copy from the Object Inspector and paste to the editor.
why? ctrl+space does not work for you?
6. This time I just quit the program without saving or changing anything.
yeah, this doesn't compute. If you press compile the IDE saved your open files before compiling, there is no way to quit with out saving.

7. That's as close to a video as I get.
No its not. Sorry but the idea is for people who know what they are looking for to point you to what ever you are doing wrong. You crying wolf and us asking if its behind the house or the mailbox is more like a Benny hill show than a debugging process.
I don't know of anyone who sits with a video camera filming them self writing code.
And I do not know anyone that does not sit down and tries to recreate the problem the moment it happened by back tracing their steps.
I copied the project to another directory and fixed all the labels and type definations.
yeah good for you, that does not answer the question though does it?

But when I compile the debugger throws an error;
and that is a good example of how not to ask a question. 1) state the error message 2)provide the code for a peer review 3) be (very) detailed in your descriptions every step must be noted for example I rename tform2 to tmywanderfullydescriptivebututerrlyimprobabletotypeform" is not a good description renamed from where? was it renamed properly on the pas file afterwards? Did the lfm file had the new name or it is still referrencing TForm2 did any messages popup that you answered yes/no/ignore and what did those messages says, not what you think/read what did they actually said copy paste the messages directly or a screen shot to be sure.
Be attentive give us something to look and scrutinize.
You sound irate. This is the fourth time I have gone thru this process and I'm getting pretty sick of this.

I do have better things to do that Troll on the form or any form.
I'm not irritated no. I only inform you why you'll get less and less attention if things progress as they are now.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

JLWest

  • Hero Member
  • *****
  • Posts: 1293
Re: Compiler renamed my classes and all procedures
« Reply #9 on: April 03, 2018, 04:52:06 am »
Version control.

I downloaded it. It will help going forward some. But not that much. If you stop and think about this:

The compiler is changing my code. That should never happen.

Not knowing why this is occurring means that I will have to write a few lines of code, compile and test,if correct then check it into version control and repeat the process.
Problem solved, I think not. What do I do write 4 lines of code, three. When done I would have 5,000+ version of code saved off.

The Compiler changes code. That is clearly an issue. It should be reported as an issue.

FPC 3.2.0, Lazarus IDE v2.0.4
 Windows 10 Pro 32-GB
 Intel i7 770K CPU 4.2GHz 32702MB Ram
GeForce GTX 1080 Graphics - 8 Gig
4.1 TB

JLWest

  • Hero Member
  • *****
  • Posts: 1293
Re: Compiler renamed my classes and all procedures
« Reply #10 on: April 03, 2018, 05:09:16 am »
I HAVE TRIED TO RECREATE IT.
I HAVE TRIED FOR THE LAST THREE HOURS.

As far as I can figure out it occurs with something like the following steps.

1. Add a label to a form.
2. Set the Caption
3. Set the Font
4. Give the label a name in the Object Inspector.
5. Got to the code editor.
6. Add the label name in a function or procedure. (In my case a Procedure)
7. Set some properties on the label. (Caption and Visible)

(Now here is where it get fuzzy but the forth time this happened I think I did the following).
8. Compile the project, and if you misspelled the label name the compiler throws an error.
9. View the object Inspector and click on the label on the screen.
10. Go to the name of the label in the Object Inspector and copy and past the name from
     the Object Inspector to the code.
11. Compile.

I think that's when it happens.
That's pretty close to the steps I did before it renamed the code.
 
 
FPC 3.2.0, Lazarus IDE v2.0.4
 Windows 10 Pro 32-GB
 Intel i7 770K CPU 4.2GHz 32702MB Ram
GeForce GTX 1080 Graphics - 8 Gig
4.1 TB

JLWest

  • Hero Member
  • *****
  • Posts: 1293
Re: Compiler renamed my classes and all procedures
« Reply #11 on: April 03, 2018, 05:25:03 am »
"well I have no idea what to say except, it never happens to me, is that more helpfull?"

That means you never had to figure out the problem.

"why? ctrl+space does not work for you?"

I don't get it? What would ctrl+space do for me.
Is there a prescribe way a typo must be corrected?
Do this correction method just apply to a label only?

"No its not. Sorry but the idea is for people  who know what they are looking for to point you
to what ever you are doing wrong. You crying wolf and us asking if its behind the house or the mailbox is more like a Benny hill show than a debugging
process."


 I don't think I'm crying wolf. I think you may be trying to shoot the messenger.
 You can't figure it out so it's the other guys fault.
 
"yeah good for you, that does not answer the question though does it?"
 
 No it doesn't answer the question?
 
 Is this something I'm doing wrong or a bug?
 
 At this point I say it's a bug.
FPC 3.2.0, Lazarus IDE v2.0.4
 Windows 10 Pro 32-GB
 Intel i7 770K CPU 4.2GHz 32702MB Ram
GeForce GTX 1080 Graphics - 8 Gig
4.1 TB

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Compiler renamed my classes and all procedures
« Reply #12 on: April 03, 2018, 05:55:52 am »
"well I have no idea what to say except, it never happens to me, is that more helpfull?"

That means you never had to figure out the problem.
true then again as far as I can tell you are the only one that has that specific problem. Until there is a way to recreate it consistently there is no indication that is an IDE bug. The compiler bug is mostly an improbable case something some one else has to address.
[/color]

"why? ctrl+space does not work for you?"


I don't get it? What would ctrl+space do for me.
speed of implementation only try it your self. on an empty line press ctrl+space a drop down list will popup, start typing your label's name and the choices in the list will get fewer and fewer and letters are added ata point you will be able to select it. Its usually faster than showing the designer selecting the OI and copying the name of the control and going back to the editor etc.
[/color]
Is there a prescribe way a typo must be corrected?
Do this correction method just apply to a label only?
No there is no prescribed way to rename anything even the controls placed using the designer can be renamed any way you want as long as you make sure you rename them everywhere that matters (lfm and pas files). As long as you keep the pas and lfm synchronised you have nothing to be afraid. We only ask you to rename from the OI because it takes care of all the known files automatically. In lazarus it tries to be a bit smart and rename it in the lines of code the pas too which sometime is more of a curse than a blessing but what you can do.

[quote author=JLWest link=topic=40754.msg281659#msg281659 date=1522725903]"No its not. Sorry but the idea is for people  who know what they are looking for to point you
to what ever you are doing wrong. You crying wolf and us asking if its behind the house or the mailbox is more like a Benny hill show than a debugging
process."


 I don't think I'm crying wolf. I think you may be trying to shoot the messenger.
 You can't figure it out so it's the other guys fault.


Actually I was intrigued the first time you posted I was looking forward to test the compiler a bit, it was a let down when no test case were provided, or any consistent methodology to recreate the problem only frustrated half backed ideas.
I do understand the frustration I wend through a similar process when I first tried lazarus things that were helpful looked like a block in my process(like appending := after you type a know variable/property, I still get annoyed from time to time) But I never claimed that the compiler was adding extract assignment operators especially with out a consistent recreation method of the problem after I had some I search how to disable it and was pointed to the code tools on the options dialog.

That is on of many examples that the IDE can be a bit of overbearing at times and gets things wrong.

[quote author=JLWest link=topic=40754.msg281659#msg281659 date=1522725903]
"yeah good for you, that does not answer the question though does it?"

 
 No it doesn't answer the question?
 
 Is this something I'm doing wrong or a bug?
 
 At this point I say it's a bug.
At this point I'm not convinced there is a bug but lets assume I'm an ignorant dumass if there is a bug the IDE is most probable place to look for it not the compiler.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Flaze07

  • New Member
  • *
  • Posts: 36
Re: Compiler renamed my classes and all procedures
« Reply #13 on: April 03, 2018, 09:19:36 am »
Why not redo the whole thing ? Or if it is too long why not share all the files, so others can try to compile it and see if we also get it wrong ??
pascal is good for learning programming language

Handoko

  • Hero Member
  • *****
  • Posts: 5158
  • My goal: build my own game engine using Lazarus
Re: Compiler renamed my classes and all procedures
« Reply #14 on: April 03, 2018, 09:41:31 am »
The OP did share the file. You can get it here:
https://forum.lazarus.freepascal.org/index.php/topic,40696.msg281277.html#msg281277

I know we all get frustrated. But lets be objective to solve the problem. The OP is not a troll, what he is lacking now is the sure steps to reproduce the issue.

...
8. Compile the project, and if you misspelled the label name the compiler throws an error.
9. View the object Inspector and click on the label on the screen.
10. Go to the name of the label in the Object Inspector and copy and past the name from
     the Object Inspector to the code.
11. Compile.

I think that's when it happens.

But at least he mentioned that he did a copying. That means it has something in the clipboard. There could be something wrong, bug, accident action, or whatever that trigger the automatic pasting into the source code.

 

TinyPortal © 2005-2018