Form X. is redefined incorrect in Class FMain
Posted
#1
(In Topic #577)
Trainee
I am doing my first steps with Gambas 3.14.3 (German language version) on Linux Mint 20.1.
On debugging my source code, I've got the error message "Form X. wird in der Klasse FMain inkorrekt redefiniert"
(which should be translated into English something like "Form X. is redefined incorrect in Class FMain".
What's the cause of this error and - even more important ;-) - how can I fix it?
Thanks a lot
Posted
Enthusiast

how about the source code? no one here is psychic.
post your project …
Admin note
This is an English language forum, please include a translation when using a different language. Thanks (Vielen Dank)
Posted
Guru

fox73 said
Hello out there,
I am doing my first steps with Gambas 3.14.3 (German language version) on Linux Mint 20.1.
On debugging my source code, I've got the error message "Form X. wird in der Klasse FMain inkorrekt redefiniert"
(which should be translated into English something like "Form X. is redefined incorrect in Class FMain".
What's the cause of this error and - even more important ;-) - how can I fix it?
Thanks a lot
It should be FMain.X or the name of your Form (or Me.X) not Form.X
Form is used in events like Form_Open() Form_Close() etc but to address the form properties use its name or Me from within it's class
there both Me.X and FMain.X mean the same thing.
Bruce
Posted
Guru

So Events will accessed like Form_EventName()
Properties are accessed with FMain.PropertyName
FMain_Open() will not work but Form_Open() will
Form.Width will not exist but FMain.Width will.
Hope that makes sense.
Bruce
Posted
Trainee
PJBlack said
wie wärs mit den source-code? hier ist nämlich niemand hellseher …
how about the source code? no one here is psychic.
Sorry PJBlack. Thought this might would be a typical rookie issue that doesn't need source code to be solved.
And by the way - the entire program has more than 650 lines of code. Should I post 'em all?
Anyway - thanks for your reply!
Posted
Trainee
BruceSteers said
It should be FMain.X or the name of your Form (or Me.X) not Form.X
Hi Bruce and thanks for your replies. In fact, it IS Form.X ! Sorry, but I cannot upload a screenshot to proof.
And - I think I found out the code that causes the error:
I have added the following declaration of a variable
:
If set this line to comment, the program runs fine and shows my form -
I remove the comment attribute - and get the error again …
Is "x" a reserved word in GamBas?
Posted
Guru

fox73 said
BruceSteers said
It should be FMain.X or the name of your Form (or Me.X) not Form.X
Hi Bruce and thanks for your replies. In fact, it IS Form.X ! Sorry, but I cannot upload a screenshot to proof.
yes taking screenshots can be exceptionally complicated.
fox73 said
And - I think I found out the code that causes the error:
I have added the following declaration of a variable
:
If set this line to comment, the program runs fine and shows my form -
I remove the comment attribute - and get the error again …
Is "x" a reserved word in GamBas?
you tell me.
here is the help page
/ - Gambas Documentation
Posted
Regular

fox73 said
…And by the way - the entire program has more than 650 lines of code. Should I post 'em all?…
Hi fox73, when you compose a post on the GambasONE forum, there are 2 tabs below; Options and Attachments.
If you can zip or compress your project, then you can attach it to your post by using Attachments > Add files.
You can also add your screenshots in a similar way, although these should not be compressed.
Please let us know if you are still having problems with this.
I hope this helps.
SteveDee
Posted
Trainee
stevedee said
If you can zip or compress your project, then you can attach it to your post by using Attachments > Add files.
You can also add your screenshots in a similar way, although these should not be compressed.
SteveDee
Oops, sorry. Didn't see those two buttons. So now here's the screenshot
As I wrote earlier, omitting the declaration of "x" resolves the problem. So I assume that "x" is a
reserved word in GamBas - is that right?
Posted
Regular

fox73 said
…omitting the declaration of "x" resolves the problem. So I assume that "x" is a
reserved word in GamBas - is that right?
The error says "Form.X" which would be the X property of a form called Form…which doesn't make sense.
Maybe just copy and paste the section of code that mentions Form.X.
Posted
Guru

Internal vars can have a $ prefix so $X will be no problem.
I think the error is that the FMain.class file Inherits Form and all form properties.
So X is already defined in the FMain.class. same applies to all variable names Form has.
Hope that makes sense.
Posted
Guru

fox73 said
Hello out there,
On debugging my source code, I've got the error message "Form X. wird in der Klasse FMain inkorrekt redefiniert"
(which should be translated into English something like "Form X. is redefined incorrect in Class FMain".
I understand this message now.
Sorry I did not before.
In English it would say
Form.x in incorrectly overridden.
Because using x tried to override the Form.x property (that your FMain.class inherits)
Posted
Trainee
stevedee said
fox73 said
…omitting the declaration of "x" resolves the problem. So I assume that "x" is a
reserved word in GamBas - is that right?
The error says "Form.X" which would be the X property of a form called Form…which doesn't make sense.
Maybe just copy and paste the section of code that mentions Form.X.
I'd like to do, but I can't, as there is NO Form.X in my source code! Here is, where Form- or Me. are mentioned:
Playing around I typed "Form." and then scrolled through the properties, if there would be an "X" - and got this message:
This makes it quite clear to me, why I cannot use a variable "X" - same for "Y" which is for the top border.
So I would say: "Problem solved - thanks and have a nice Sunday."
Oops - just saw that Bruce already posted the solution. Thanks a lot.
1 guest and 0 members have just viewed this.





