FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Show the last 5 record
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Show the last 5 record
Posted: Sun May 07, 2017 03:29 PM

How I can show on a xbrowse only the last 5 record from a archive ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 2064
Joined: Fri Jan 06, 2006 09:28 PM
Re: Show the last 5 record
Posted: Sun May 07, 2017 07:03 PM

Buen dia, probastes hacer un array ordenado por nRow descendente y luego leer los 5 primeros y agregarlos a oBrw:aArraydata.? Solo es una idea al vuelo, saludos... :shock:

Dios no está muerto...



Gracias a mi Dios ante todo!
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Show the last 5 record
Posted: Sun May 07, 2017 09:23 PM
Silvio,

works with any index :

using a FILTER

nTop := ("CUST")->( RECCOUNT() ) - 4
("CUST")->( DBSETFILTER( {|| ("CUST")->( RECNO() ) >= nTop } ) )
("CUST")->( DBGOTOP() )


or using ORDSCOPE with the same result :

INDEX ON ("CUST")->( RECNO() ) TO "CUST1" // index on record-numbers
nTop := ("CUST")->( RECCOUNT() ) - 4
nBottom := ("CUST")->( RECCOUNT() )

("CUST")->( ORDSCOPE(0, NIL ) ) // reset
("CUST")->(ORDSCOPE(1, NIL ) ) // reset

("CUST")->(ORDSCOPE(0, nTop )) // set top scope
("CUST")->(ORDSCOPE(1, nBottom )) // set bottom scope
("CUST")->( DBGOTOP() )




regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Show the last 5 record
Posted: Mon May 08, 2017 04:09 PM

YES RUN OK

FIRST SAMPLE

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com

Continue the discussion