Index / Order in CDX

Index / Order in CDX

Postby TimStone » 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
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Index / Order in CDX

Postby nageswaragunupudi » Thu Sep 15, 2011 12:37 am

Code: Select all  Expand view
for n := 1 to OrdCount()
AAdd( aTags, { OrdName( n ), OrdBagName( n ), OrdKey( n ) } )
next n


 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Index / Order in CDX

Postby TimStone » Fri Sep 16, 2011 4: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
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Index / Order in CDX

Postby nageswaragunupudi » 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
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Index / Order in CDX

Postby TimStone » Sun Sep 18, 2011 5: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
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 92 guests