oCol:bStrData := {||iif( oBrw:nArrayAt > 1 .and. aArray[oBrw:nArrayAt][1] == aArray[oBrw:nArrayAt-1][1], space(10),aArray[oBrw:nArrayAt][1] )}
/*
Purpose: Display city name only on first occurance in a browse
Date : 12/23/2007
Author : James Bott, jbott@compuserve.com
Note : Requires TData class
*/
#include "fivewin.ch"
function main()
local oWnd, oLbx, oCustomer
use customer exclusive
index on upper(city) to cust2
use
oCustomer:= TCustomer():new()
//oCustomer:setOrder(2)
oCustomer:gotop()
define window oWnd title "Test City Group"
@0,0 listbox oLbx fields oCustomer:firstCity(), oCustomer:city, oCustomer:last, oCustomer:first;
headers "City","City","Last","First";
sizes 100,100,100,100;
alias oCustomer:cAlias;
of oWnd
oLbx:bSkip := {| nRecs | oCustomer:skipper( nRecs ) }
oWnd:oClient:= oLbx
activate window oWnd
oCustomer:end()
return nil
//---------------------------------------------------------------------------//
class TCustomer from TData
method new
method firstCity
endclass
//---------------------------------------------------------------------------//
method new()
super():new(,"customer")
::use()
//::addIndex("cust1") // primary key
::addIndex("cust2") // city
::gotop()
return self
//---------------------------------------------------------------------------//
method firstCity()
local cPrev,cCurrent
cCurrent:= ::city
::skip(-1)
cPrev:= ::city
::skip()
return if( cCurrent = cPrev, "", cCurrent)
// end
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: nageswaragunupudi and 89 guests