Migration xbase to X# --> Compiling

This forum is meant for questions and discussions about the X# language and tools
AlfredJanssen
Posts: 9
Joined: Mon May 25, 2026 12:13 pm
Location: DE

Migration xbase to X# --> Compiling

Post by AlfredJanssen »

Hi everyone,
I am currently migrating an Xbase++ application to X#. I am using the /dialect:xpp setting. I have encountered a major issue where the compiler enters an infinite loop when processing BEGIN SEQUENCE blocks, especially when they are combined with an ErrorBlock() setup. Habe anyone a idea for solve this problem?
Greetings, Alfred
User avatar
Chris
Posts: 5764
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: Migration xbase to X# --> Compiling

Post by Chris »

Hi Alfred,

Can you create a small code sample reproducing the problem?
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
AlfredJanssen
Posts: 9
Joined: Mon May 25, 2026 12:13 pm
Location: DE

Re: Migration xbase to X# --> Compiling

Post by AlfredJanssen »

Hi.
Is a one PRG file sufficient, or does it have to be a runnable program?
AlfredJanssen
Posts: 9
Joined: Mon May 25, 2026 12:13 pm
Location: DE

Re: Migration xbase to X# --> Compiling

Post by AlfredJanssen »

Chris wrote: Thu May 28, 2026 12:51 pm Hi Alfred,

Can you create a small code sample reproducing the problem?
Hi Chris.
Here is a sample, under xBase is working.
Greetings, Alfred
Attachments
TEST_PRG_FOR_X#.zip
Here a short running able sample
(14.42 KiB) Downloaded 9 times
AlfredJanssen
Posts: 9
Joined: Mon May 25, 2026 12:13 pm
Location: DE

Re: Migration xbase to X# --> Compiling

Post by AlfredJanssen »

AlfredJanssen wrote: Fri May 29, 2026 10:10 am
Chris wrote: Thu May 28, 2026 12:51 pm Hi Alfred,

Can you create a small code sample reproducing the problem?
Hi Chris.
Here is a sample, under xBase is working.
Greetings, Alfred

... look please in the compilieren.bat File too for correct calling the compiler ...
User avatar
Chris
Posts: 5764
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: Migration xbase to X# --> Compiling

Post by Chris »

Hi Alfred,

Sorry, I missed your first poss, yes it always helps if the sample is runnable. But I could still find the problem with the one you sent, you're right it's because of the BEGIN SEQUENCE blocks. Actually the problem is the ENDSEQUENCE command, there's a bug in the UDC/preprocessor which enters an endless loop trying to preprocess this command. We will fix this, but for now please change "ENDSEQUENCE" to "END SEQUENCE" and this problem will go away.

After that, you will get an error on this line:

Code: Select all

   bErr := ErrorBlock( {|o| BREAK(o) } )

For now you'll need to change BREAK(o) to _Break(o), but I will open a report for this, to enable using BREAK() in the xBase dialect.

Finally, you will get an error on

Code: Select all

SET CHARSET TO OEM

This command is not implemented, so you either need to implement it with a UDC yourself, or comment this code for now.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
AlfredJanssen
Posts: 9
Joined: Mon May 25, 2026 12:13 pm
Location: DE

Re: Migration xbase to X# --> Compiling

Post by AlfredJanssen »

Is there a function in X# that sets the code page? Otherwise, the contents of the DBF files cannot be read correctly.
User avatar
robert
Posts: 5149
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Re: Migration xbase to X# --> Compiling

Post by robert »

Alfred
AlfredJanssen wrote: Fri May 29, 2026 12:50 pm Is there a function in X# that sets the code page? Otherwise, the contents of the DBF files cannot be read correctly.
XSharp uses the DBF header to decode the codepage.
If that does not work correctly, then please send us an example table.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
Chris
Posts: 5764
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: Migration xbase to X# --> Compiling

Post by Chris »

Hi Alfred,

I think it's SetAnsi(FALSE) that you are looking for. If that's what XBase++ does as well with this command, you can also add this UDC in your code

Code: Select all

#command SET CHARSET TO OEM => SetAnsi(FALSE)
and then you can keep the command version in your code.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
AlfredJanssen
Posts: 9
Joined: Mon May 25, 2026 12:13 pm
Location: DE

Re: Migration xbase to X# --> Compiling

Post by AlfredJanssen »

Thank you, i check your idea.
Post Reply