FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Index / Order in CDX
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Index / Order in CDX
Posted: Thu Sep 15, 2011 12:27 AM

When I open a CDX file, I know the indexes ( orders ) open automatically.

Is there a command that returns the available index names ? I want to create a dropdown list with the available indexes so I can select which order I want to apply, and switch them.

Normally I know all the names when I start to use a file, but in this case, I could be selecting any file !

Thanks for the input. I use DBFCDX and ADS for my RDD's.

Tim

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Index / Order in CDX
Posted: Thu Sep 15, 2011 12:37 AM
Code (fw): Select all Collapse
for n := 1 to OrdCount()
AAdd( aTags, { OrdName( n ), OrdBagName( n ), OrdKey( n ) } )
next n
Regards



G. N. Rao.

Hyderabad, India
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: Index / Order in CDX
Posted: Fri Sep 16, 2011 04:12 PM

I worked it out. I'm using data objects, ( tdatabase / tdata ) and OrdCount( ) is not supported. The proper code for someone using tdatabase / tdata is:

    for n := 1 to OrdKeyCount()
        AAdd( aTags, oDbf:IndexName( n ) , oDbf:IndexBag( n ), oDbf:IndexKey( n ) } )
    next n

Then aTags provides the desired list.

Thanks for providing the direction.

Tim

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Index / Order in CDX
Posted: Fri Sep 16, 2011 10:15 PM

OrdKeyCount() does not return number of open index-tags. This function returns number of records in an index/tag.

OrdCount() returns the number of Tags open. This function is supported by RDD and is available whether we use a class or not.

If we are using a TDatabase like object, we can use ( oDbf:nArea )->( OrdCount() )

Regards



G. N. Rao.

Hyderabad, India
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: Index / Order in CDX
Posted: Sun Sep 18, 2011 05:27 PM

Thanks for the clarification. I have implemented it successfully.

Tim

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit

Continue the discussion