Workarea not indexed ?????

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

Workarea not indexed ?????

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

Re: Workarea not indexed ?????

Post by robert »

Can you send us the files?

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

Re: Workarea not indexed ?????

Post 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.
Attachments
AliasError.ZIP
(1.28 MiB) Downloaded 1062 times
RolWil
Posts: 99
Joined: Mon Jul 18, 2022 3:16 am

Re: Workarea not indexed ?????

Post by RolWil »

Hi Robert,

did you find anything?
User avatar
Chris
Posts: 5468
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: Workarea not indexed ?????

Post 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?
Chris Pyrgas

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

Re: Workarea not indexed ?????

Post 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
User avatar
Chris
Posts: 5468
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: Workarea not indexed ?????

Post 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?
Chris Pyrgas

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

Re: Workarea not indexed ?????

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