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
Form X. is redefined incorrect in Class FMain
Re: Form X. is redefined incorrect in Class FMain
wie wärs mit den source-code? hier ist nämlich niemand hellseher ...
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)
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)
- BruceSteers
- Posts: 1607
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: Form X. is redefined incorrect in Class FMain
It should be FMain.X or the name of your Form (or Me.X) not Form.Xfox73 wrote: ↑Tuesday 9th February 2021 1:45am 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
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
Public Sub Form_Open()
Me.X = 25
Wait 1
FMain.X = 50
End
there both Me.X and FMain.X mean the same thing.Bruce
If at first you don't succeed , try doing something differently.
BruceS
BruceS
- BruceSteers
- Posts: 1607
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: Form X. is redefined incorrect in Class FMain
You can imagine the IDE does this when it creates a default Form (FMain)...
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
Public FMain As Form
Public Sub Main()
FMain = New Form As "Form"
End
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
If at first you don't succeed , try doing something differently.
BruceS
BruceS
Re: Form X. is redefined incorrect in Class FMain
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!
Re: Form X. is redefined incorrect in Class FMain
Hi Bruce and thanks for your replies. In fact, it IS Form.X ! Sorry, but I cannot upload a screenshot to proof.BruceSteers wrote: ↑Tuesday 9th February 2021 4:57am It should be FMain.X or the name of your Form (or Me.X) not Form.X
And - I think I found out the code that causes the error:
I have added the following declaration of a variable
:
Public x as Integer
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?
- BruceSteers
- Posts: 1607
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: Form X. is redefined incorrect in Class FMain
yes taking screenshots can be exceptionally complicated.fox73 wrote: ↑Saturday 13th February 2021 4:45amHi Bruce and thanks for your replies. In fact, it IS Form.X ! Sorry, but I cannot upload a screenshot to proof.BruceSteers wrote: ↑Tuesday 9th February 2021 4:57am It should be FMain.X or the name of your Form (or Me.X) not Form.X
you tell me.fox73 wrote: ↑Saturday 13th February 2021 4:45am 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 -
Public x as Integer
I remove the comment attribute - and get the error again ...
Is "x" a reserved word in GamBas?
here is the help page
http://gambaswiki.org/wiki/
Last edited by BruceSteers on Saturday 13th February 2021 6:43pm, edited 1 time in total.
If at first you don't succeed , try doing something differently.
BruceS
BruceS
Re: Form X. is redefined incorrect in Class FMain
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
Re: Form X. is redefined incorrect in Class FMain
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?
Re: Form X. is redefined incorrect in Class FMain
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.