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
Migration xbase to X# --> Compiling
-
AlfredJanssen
- Posts: 9
- Joined: Mon May 25, 2026 12:13 pm
- Location: DE
Re: Migration xbase to X# --> Compiling
Hi Alfred,
Can you create a small code sample reproducing the problem?
Can you create a small code sample reproducing the problem?
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
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
Hi.
Is a one PRG file sufficient, or does it have to be a runnable program?
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
Hi Chris.Chris wrote: Thu May 28, 2026 12:51 pm Hi Alfred,
Can you create a small code sample reproducing the problem?
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
AlfredJanssen wrote: Fri May 29, 2026 10:10 amHi Chris.Chris wrote: Thu May 28, 2026 12:51 pm Hi Alfred,
Can you create a small code sample reproducing the problem?
Here is a sample, under xBase is working.
Greetings, Alfred
... look please in the compilieren.bat File too for correct calling the compiler ...
Re: Migration xbase to X# --> Compiling
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:
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
This command is not implemented, so you either need to implement it with a UDC yourself, or comment this code for now.
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 OEMThis 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
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
Is there a function in X# that sets the code page? Otherwise, the contents of the DBF files cannot be read correctly.
Re: Migration xbase to X# --> Compiling
Alfred
If that does not work correctly, then please send us an example table.
Robert
XSharp uses the DBF header to decode the codepage.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.
If that does not work correctly, then please send us an example table.
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu
Re: Migration xbase to X# --> Compiling
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
and then you can keep the command version in your code.
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)Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
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
Thank you, i check your idea.

