FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse AUTOSORT DBF does not work
Posts: 838
Joined: Wed Aug 22, 2007 10:09 AM

xBrowse AUTOSORT DBF does not work

Posted: Wed Dec 25, 2019 06:17 PM
Hello,

I have an xBrowse defined such way:

Code (fw): Select all Collapse
  @ 14,72 XBROWSE oVMenuBrowse SIZE -10,-21 PIXEL OF oDlg ;
          ALIAS "CLIENTES" AUTOSORT;
          FIELDS CLIENTES->CODIGO,CLIENTES->NOMBRE ;
          HEADERS "Código", "Nombre"  ;
          SIZES  90, 80


Indexes are:

Code (fw): Select all Collapse
   INDEX ON NOMBRE TAG CLIENTES1  FOR !Deleted()
   INDEX ON CODIGO TAG CLIENTES2  FOR !Deleted()


Thank you.
Saludos / Regards,



FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Re: xBrowse AUTOSORT DBF does not work

Posted: Thu Dec 26, 2019 04:05 AM
Code (fw): Select all Collapse
@ 14,72 XBROWSE oVMenuBrowse SIZE -10,-21 PIXEL OF oDlg ;
          ALIAS "CLIENTES" AUTOSORT;
          COLUMNS "CODIGO","NOMBRE" ;
          HEADERS "Código", "Nombre"  ;
          SIZES  90, 80

Autosort works when you use COLUMNS clause like this. Does not work when you use FIELDS clause.

We advise you to use COLUMNS clause only and never to use FIELDS clause.

Note: FIELDS clause was created for compatibility with WBrowse syntax to ease initial migration.
Regards



G. N. Rao.

Hyderabad, India
Posts: 838
Joined: Wed Aug 22, 2007 10:09 AM

Re: xBrowse AUTOSORT DBF does not work

Posted: Thu Dec 26, 2019 09:23 AM

Thank you.

But in some xbrowse cols, I have defined the field like this:

( CONCEPTO->IMPORTE + (CONCEPTO->IMPORTECONCEPTO->IVA/100) - (CONCEPTO->IMPORTECONCEPTO->IRPF/100) )

But in COLUMNS clause does not work. How should I proceed please?

Saludos / Regards,



FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Re: xBrowse AUTOSORT DBF does not work

Posted: Thu Dec 26, 2019 10:01 AM
In the COLUMNS clause, we can include expressions also, as long as the expression can be evaluated in another module, i.e., expressions not containing local variables or static functions.

The above can be written as
Code (fw): Select all Collapse
COLUMNS "IMPORTE+(IMPORTE*IVA/100)-(IMPORTE*IRPF/100)", "NEXTCOL", ...


Incidentally, the expression IMPORTE+(IMPORTE*IVA/100)-(IMPORTE*IRPF/100) can be simplified as IMPORTE * ( 1 + ( IVA-IRPF) / 100 )

So we can write
Code (fw): Select all Collapse
COLUMNS "IMPORTE * ( 1 + ( IVA-IRPF) / 100 )", "NEXTCOL", ...
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion