Show the last 5 record

Show the last 5 record

Postby Silvio.Falconi » Sun May 07, 2017 3: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6834
Joined: Thu Oct 18, 2012 7:17 pm

Re: Show the last 5 record

Postby joseluisysturiz » Sun May 07, 2017 7: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!
User avatar
joseluisysturiz
 
Posts: 2064
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela

Re: Show the last 5 record

Postby ukoenig » Sun May 07, 2017 9: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() )


Image

regards
Uwe :D
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Show the last 5 record

Postby Silvio.Falconi » Mon May 08, 2017 4:09 pm

YES RUN OK

FIRST SAMPLE
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6834
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: lzanardo, nageswaragunupudi and 37 guests