xsharp.eu • Workarea not indexed ?????
Page 1 of 1

Workarea not indexed ?????

Posted: Fri Mar 28, 2025 3:34 pm
by RolWil
My stack: Windows Forms, Harbour. XSharp in VS is current 2.20

Here’s a ‘fun’ one:

Code: Select all

   
    PRIVATE METHOD DO_DETAIL() AS VOID STRICT   
        close all
       
       // use e:\Apps\HarborClipper\TargetDataTests\Flexx\bfcl index e:\Apps\HarborClipper\TargetDataTests\Flexx\bfcl new shared 
           
        USE ("BFCL.DBF") INDEX ("BFCL") ALIAS BFCLXX NEW SHARED
        
        select BFCLXX
        BFCLXX->(DBSEEK("TEST"))      //  This line yields a "Workarea not indexed" error if the initial "use" command if left commented out.
  
        RETURN
    END METHOD   
   
   
If the first ‘use’ command line is left commented out, the program fails on a ’workarea not indexed’ error.
Reinstating the line, lets it go. These are two different BFCL files. Why? Code could not be any simpler.

Thanks for your help.

Error:
workarea.jpg

Re: Workarea not indexed ?????

Posted: Sat Mar 29, 2025 8:51 am
by robert
Can you send us the files?

Robert

Re: Workarea not indexed ?????

Posted: Sat Mar 29, 2025 6:58 pm
by RolWil
robert wrote: Sat Mar 29, 2025 8:51 am Can you send us the files?

Robert
Hi Robert,

here's the test project, including the two sets of files.

Re: Workarea not indexed ?????

Posted: Thu Apr 03, 2025 7:16 pm
by RolWil
Hi Robert,

did you find anything?

Re: Workarea not indexed ?????

Posted: Thu Apr 03, 2025 8:19 pm
by Chris
Hi Roland,

Looks like the problem is in the index expression, which includes an alias:

Code: Select all

BFCL->FC_CLIDEN
When you use a different alias when you open the dbf (like "bfcl1" and "bfcl2" in your sample), the "BFCL" alias does not exist, hence the error.

Is there any reason why you needed to specify an alias in the index expression string?

Re: Workarea not indexed ?????

Posted: Sun Apr 06, 2025 7:30 pm
by RolWil
Chris wrote: Thu Apr 03, 2025 8:19 pm Hi Roland,

Looks like the problem is in the index expression, which includes an alias:

Code: Select all

BFCL->FC_CLIDEN
When you use a different alias when you open the dbf (like "bfcl1" and "bfcl2" in your sample), the "BFCL" alias does not exist, hence the error.

Is there any reason why you needed to specify an alias in the index expression string?
Hi Chris,

This is not the problem unfortunately. But just to make sure, I changed the code ... and it's not working.

Regards,
Roland

Re: Workarea not indexed ?????

Posted: Sun Apr 06, 2025 8:29 pm
by Chris
Hi Roland,

I had also tested the code and it was working here with this change. What is the exact code you are using now?

Re: Workarea not indexed ?????

Posted: Thu Apr 24, 2025 9:12 pm
by RolWil
Chris wrote: Sun Apr 06, 2025 8:29 pm Hi Roland,

I had also tested the code and it was working here with this change. What is the exact code you are using now?
Thanks for all the tips ... however, non were realistic to implement - I'm implementing a Windows version in parallel to the original one and doesn't allow me to create new indexes without the alias reference ... which is so old, I can't even remember why I coded it to begin with.

So, I've thought of a solution but ... of course, I can't figure something out. I'll post it under a new item.

Regards,
Roland