XSharp Cahors 2.13. Broke my Code

This forum is meant for questions about the Visual FoxPro Language support in X#.

Post Reply
User avatar
Florentin Lüdeking
Posts: 11
Joined: Tue Aug 02, 2022 1:42 pm

XSharp Cahors 2.13. Broke my Code

Post 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 :(
User avatar
robert
Posts: 4518
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

XSharp Cahors 2.13. Broke my Code

Post 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 Development Team
The Netherlands
robert@xsharp.eu
User avatar
Florentin Lüdeking
Posts: 11
Joined: Tue Aug 02, 2022 1:42 pm

XSharp Cahors 2.13. Broke my Code

Post 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
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

XSharp Cahors 2.13. Broke my Code

Post 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
User avatar
Florentin Lüdeking
Posts: 11
Joined: Tue Aug 02, 2022 1:42 pm

XSharp Cahors 2.13. Broke my Code

Post 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
User avatar
robert
Posts: 4518
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

XSharp Cahors 2.13. Broke my Code

Post 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:

Code: Select all

PRIVATE <var> AS <type>

is now only supported in the FoxPro dialect and when the "Enable Memvar Support" option is enabled
the other dialects only support

Code: Select all

PRIVATE <var>

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 Development Team
The Netherlands
robert@xsharp.eu
User avatar
Florentin Lüdeking
Posts: 11
Joined: Tue Aug 02, 2022 1:42 pm

XSharp Cahors 2.13. Broke my Code

Post by Florentin Lüdeking »

That worked!

Thank you very much Robert :)
Post Reply