Page 1 of 1
XSharp Cahors 2.13. Broke my Code
Posted: Tue Oct 11, 2022 8:40 am
by Florentin Lüdeking
Hey everyone, i really need some help with this!
Before i updated to XSharp Cahors 2.13. this Code worked :
Code: Select all
PRIVATE gcTextfeldvalue AS STRING
gcTextfeldvalue = "Hier könnte Ihre Werbung stehen"
Now i Get this Error:
XS9002 Parser: unexpected input 'PRIVATE'
Can someone please help me with this i have no clue whats going on
XSharp Cahors 2.13. Broke my Code
Posted: Tue Oct 11, 2022 9:35 am
by robert
Florentin,
Can you show a bit more context ?
I think the parser gets confused and thinks that the PRIVATE gcTextfeldvalue is a field in the class.
Robert
XSharp Cahors 2.13. Broke my Code
Posted: Tue Oct 11, 2022 9:44 am
by Florentin Lüdeking
That is the whole File (Without Usings for less clutter)
It worked exactly like this before i updated it.
Code: Select all
BEGIN NAMESPACE Import
FUNCTION Start() AS VOID
Application.EnableVisualStyles()
Application.SetCompatibleTextRenderingDefault( FALSE )
PRIVATE gcTextfeldvalue AS STRING
gcTextfeldvalue = "Hier könnte Ihre Werbung stehen"
PRIVATE cZwFormAufruf AS STRING
cZwFormAufruf = "konvert_basis1"
_CallClipFunc(cZwFormAufruf)
RETURN
END NAMESPACE
XSharp Cahors 2.13. Broke my Code
Posted: Tue Oct 11, 2022 11:25 am
by ic2
Hello Florentin,
I'd say that you define PRIVATE in a class.
In a function like you write PRIVATE gcTextfeldvalue As String fails. LOCAL gcTextfeldvalue As String works.
Dick
XSharp Cahors 2.13. Broke my Code
Posted: Tue Oct 11, 2022 11:41 am
by Florentin Lüdeking
No i dont define PRIVATE anywhere.
There are no occurences other than
Code: Select all
PRIVATE variable AS INT
PRIVATE METHOD method AS VOID
I dont use it in any other context and like i said, it worked before i updated it.
Florentin
XSharp Cahors 2.13. Broke my Code
Posted: Tue Oct 11, 2022 11:45 am
by robert
Florentin,
Are you sure that your application is using the FoxPro dialect and the the option to "Enable Memvar Support" on the Language Tab of the project properties is selected?
We changed some rules in 2.13 parser, because sometimes the compiler was confusing PRIVATE memory variables with PRIVATE fields inside a class.
However in your example code there is no class, so no confusion.
The change that we made is this:
is now only supported in the FoxPro dialect and when the "Enable Memvar Support" option is enabled
the other dialects only support
but also only when the "Enable Memvar Support" option is enabled.
Even though in the FoxPro dialect you are allowed to add AS <type>, you must know that Private variables are never typed, but they are always of type USUAL.
The "AS <type>" clause is recognized by the parser but will produce a warning:
Code: Select all
XS9230: The 'AS STRING' clause is not supported and ignored.
Robert
XSharp Cahors 2.13. Broke my Code
Posted: Tue Oct 11, 2022 11:47 am
by Florentin Lüdeking
That worked!
Thank you very much Robert