Corruption detected on an index ... but NOT if index created within XSharp

This forum is meant for questions and discussions about the X# language and tools
RolWil
Posts: 68
Joined: Mon Jul 18, 2022 3:16 am

Corruption detected on an index ... but NOT if index created within XSharp

Post by RolWil »

Hi All,

I’m Converting from harbour Clipper to XSharp, Harbor dialect and am doing so in Visual Studio.
I wish I could tell you what version of XSharp I’m using, but don’t know how to tell, despite searching with Google and this forum … perhaps someone could enlighten me please 😊

In my application is a function that performs calculations on about 10,000 people.

When I run the converted process with an active index created using the old Harbour version, after about 1400 records, I get the pop-up error widow you see an image of below.

However, if I create the index within the XSharp Windows version, the process completes calculations on all 10,000 records without error.

The Error occurs on a “file->dbskip()” statement inside a loop.

In the VS Output tab/pane, I get:

Exception thrown: 'XSharp.Internal.WrappedException' in XSharp.RT.dll
Exception thrown: 'XSharp.Error' in XSharp.RT.dll

The error pop-up (image below) indicates there was ‘corruption’ and ‘key not found’.

This is the key, it’s pretty straight forward:

BFMB->FC_MBCLIE+BFMB->FC_MBDIVI+BFMB->FC_MBGROU+BFMB->FC_MBIDEN

As always, thanks for your help.

The error pop up:
Attachments
XSharpErr.png
User avatar
robert
Posts: 4518
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Re: Corruption detected on an index ... but NOT if index created within XSharp

Post by robert »

Roland,
The easiest way to see the version of X# is to look at the Help-About screen in VS , and scroll to the bottom until you see the X# project system listed.

W.r.t. the index corruption:
Most likely this is related to what is called "the collation", the sort table for indices.
You need to show us the settings for your Harbour app and the link script.
In X# you can set everything in code, and we need to make sure that the settings on both sides are equal.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
RolWil
Posts: 68
Joined: Mon Jul 18, 2022 3:16 am

Re: Corruption detected on an index ... but NOT if index created within XSharp

Post by RolWil »

Hi Robert, many thanks for your answers.

I’m currently running XSharp 2.14.04

I’m attaching images of my settings but don’t know where to find a ‘link script’ and can’t find related any information; perhaps you could tell me where to find it.

Regards,
Roland


NOTE: I cannot add images, my attempts simply fail - no error. I've tried using 'attachments' and drag/drop, neither work for me. I can't even delete this post. I'll try tomorrow again.
User avatar
Chris
Posts: 4898
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: Corruption detected on an index ... but NOT if index created within XSharp

Post by Chris »

Hi Roland,

Please select "Attachments" below the email text and press the button "Add files", this should allow you to select the files from disk directly. Does that work?
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
RolWil
Posts: 68
Joined: Mon Jul 18, 2022 3:16 am

Re: Corruption detected on an index ... but NOT if index created within XSharp

Post by RolWil »

Hi Chris,

that's what I did first and it worked once, but I needed to add another image. After I tried that and attempted a 'preview' there were no images, not even the original one and from then on, I couldn't add any.

My next step is to start with a new post.

Roland
RolWil
Posts: 68
Joined: Mon Jul 18, 2022 3:16 am

Re: Corruption detected on an index ... but NOT if index created within XSharp

Post by RolWil »

Second attempt at replying with attached image.


Hi Robert, many thanks for your answers.

I’m currently running XSharp 2.14.04

I’m attaching images of my settings but don’t know where to find a ‘link script’ and can’t find related any information; perhaps you could tell me where to find it.

Regards,
Roland
Attachments
XSharp_Settings.png
RolWil
Posts: 68
Joined: Mon Jul 18, 2022 3:16 am

Re: Corruption detected on an index ... but NOT if index created within XSharp

Post by RolWil »

OK, I added:

SetCollation("Clipper")

to the top of my initialization code and the error still occurs.

I should mention that I'm using the DBFNTX RDD.
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Re: Corruption detected on an index ... but NOT if index created within XSharp

Post by wriedmann »

Hi Roland,
if you are using SetCollation( #Clipper ) you need also to specify which language with SetNatDll(). This setting has to reflect what you are using in your other application.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
robert
Posts: 4518
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Re: Corruption detected on an index ... but NOT if index created within XSharp

Post by robert »

With the link script ( maybe not the right we orde) I meant the libraries and files that you referring to in your harbour program.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
RolWil
Posts: 68
Joined: Mon Jul 18, 2022 3:16 am

Re: Corruption detected on an index ... but NOT if index created within XSharp

Post by RolWil »

Hi Wolfgang and thank you.

Here's what I now have ... but still get the error:

SetAnsi(.t.)
SetCollation("Clipper")
SetNatDLL("ENGLISH")
RDDSetDefault("DBFNTX")
Post Reply