AUTOSORT xBrowse

AUTOSORT xBrowse

Postby Otto » Sat Jun 22, 2019 8:44 pm

Dear Mr. Rao,
how can we use AUTOSORT with dbf files which do not have indexes.
Should we create for every field an index.
I tryed with FW_CdxCreate(,.t.) .
Is this the right way or is there an ad hoc indexing way. Only for one column.

Thank you in advance
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6346
Joined: Fri Oct 07, 2005 7:07 pm

Re: AUTOSORT xBrowse

Postby nageswaragunupudi » Sun Jun 23, 2019 11:49 am

I tryed with FW_CdxCreate(,.t.) .

Yes, this is the right way.
This creates index tags on all columns in a temporary index. This index will be removed after the dbf is closed. Useful for autosort.
Code: Select all  Expand view  RUN
function TempTest()

   local oDlg, oBrw

   USE CUSTOMER SHARED NEW VIA "DBFCDX"
   FW_CdxCreate( nil, .t. )  // create temporary index

   DEFINE DIALOG oDlg SIZE 700,400 PIXEL TRUEPIXEL

   @ 20,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      DATASOURCE "CUSTOMER" AUTOCOLS AUTOSORT ;
      CELL LINES NOBORDER

   oBrw:CreateFromCode()

   ACTIVATE DIALOG oDlg CENTERED

return nil
 

FW_CdxCreate( [cFieldList], [lMemory] )

You can create index on one or more fields by specifying the list of fields in the first parameter. Default is all fields.
If lMemory is .t., a temporary index is created in memory. By default, it creates a normal index on the disk and we need to open the dbf in exclusive mode.
Regards

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 54 guests

cron