x:= 25
SET FILTER TO AGE >= x
DBGOTOP()
x:= 25
cFilter := "AGE >="+STR(x)
bFilter := "{||"+cFilter+¨}"
DBSETFILTER(&bFilter,cFilter)
DBGOTOP()
cFilter := "(4->me_serial == )"+x
If you are used to Filters the best way is to use the ADS LOCAL server. The SET FILTER under ADS is hundred of times faster than the standard (x)Harbour filter
select 4
USE METE
x:= "9855564"
cFilter := "4->me_serial = "+x
bFilter := "{||"+cFilter+"}"
DBSETFILTER(&bFilter,cFilter)
DBGOTOP()
static oWnd
static coname
static custDlg
static oFWnd,oFld1
extern AdsKeyCount, AdsGetRelKeyPos, AdsSetRelKeyPos
#command SET SERVER LOCAL => AdsSetServerType ( 1 )
#command SET SERVER REMOTE => AdsSetServerType ( 2 )
#command SET FILETYPE TO <x:NTX,CDX,ADT> ;
=> AdsSetFileType( if( upper( <(x)> ) == "NTX", 1, ;
if( upper( <(x)> ) == "CDX", 2, 3 ) ) )
STATIC cState := ""
//----------------------------------------------------------------------------//
function Main()
local oBrush, oBar, oBmp
/*REQUEST DBFCDX
rddsetdefault( "DBFCDX" )*/
REQUEST ADS
rddRegister( "ADS", 1 )
rddsetdefault( "ADS" )
SET SERVER LOCAL
SET FILETYPE TO CDX
select 1
USE cust
INDEX ON upper(cust->cu_acct) TO cust
INDEX ON upper(cust->cu_name) TO cust1
INDEX ON upper(cust->cu_coun) TO cust2
INDEX ON upper(cust->cu_city) TO cust3
INDEX ON upper(cust->cu_gove) TO cust4
INDEX ON upper(cust->cu_stre) TO cust5
INDEX ON upper(cust->cu_phon) TO cust6
INDEX ON upper(cust->cu_fax ) TO cust7
INDEX ON upper(cust->cu_mobi) TO cust8
INDEX ON upper(cust->cu_man ) TO cust9
INDEX ON upper(cust->cu_appr) TO cust10
SET INDEX TO cust
select 2
USE cont
INDEX ON cont->CT_CU_ACCT+dtoc(cont->ct_strd) TO cont
INDEX ON cont->CT_CU_name TO cont1
INDEX ON dtoc(cont->ct_strd) TO cont2
INDEX ON dtoc(cont->ct_endd) TO cont3
INDEX ON cont->CT_machno TO cont4
INDEX ON cont->CT_mamc TO cont5
INDEX ON cont->ct_paymet TO cont6
INDEX ON cont->ct_payamt TO cont7
INDEX ON cont->ct_currenc TO cont8
INDEX ON cont->ct_excmet TO cont9
INDEX ON cont->ct_excamt TO cont10
INDEX ON cont->ct_minvol TO cont11
SET INDEX TO cont
select 3
use mach
index on mach->MC_CU_ACCT to mach
index on UPPER(mach->MC_ct_ctna) to mach1
index on UPPER(mach->MC_model) to mach2
index on UPPER(mach->MC_TYPE)+UPPER(mach->MC_model) to mach3
index on UPPER(mach->MC_serial) to mach4
index on UPPER(mach->MC_meres) to mach5
index on UPPER(mach->MC_brn) to mach6
select 4
select 4
use mete
index on mete->ME_serial to mete
index on str(mete->year) + str(mete->month) to mete1
index on mete->me_date to mete2
select 5
use coun
select 6
use city
select 7
use gove
SET 3DLOOK ON // Microsoft 3D Look
* DEFINE BRUSH oBrush STYLE TILED // FiveWin new predefined Brushes
*colors iniColor("windowText"),iniColor("appWorkSpace");
*colors iniColor("graytext"),iniColor("appWorkSpace");
DEFINE WINDOW oWnd FROM 4, 4 TO 25, 75 ;
colors CLR_BLACK,CLR_LIGHTGRAY;
TITLE "Xerox Application for Outsourcing Works" ;
MENU BuildMenu()
DEFINE BITMAP oBmp RESOURCE "Background"
set century on
set date format to "DD/MM/YYYY"
SET 3DLOOK ON // Microsoft 3D Look
// ON RESIZE oBmp:Center()
SET MESSAGE OF oWnd TO FWVERSION + ", " + FWCOPYRIGHT CENTERED TIME DATE
oWnd:bPainted = { | hDC | BmpTiled( hDC, oWnd, oBmp ) }
ACTIVATE WINDOW oWnd MAXIMIZED
return nil
select 4
USE METE
x:= "9855564"
cFilter := "me_serial = "+x
bFilter := "{||"+cFilter+"}"
DBSETFILTER(&bFilter,cFilter)
DBGOTOP()
STATIC FUNCTION Footers( oWnd )
*--------------------------
local oChild, oBrw
local nFor
local bFilter := ""
local cFilter := ""
local x := ""
REQUEST ADS
rddRegister( "ADS", 1 )
rddsetdefault( "ADS" )
AdsSetDeleted(.T.)
SET SERVER LOCAL
SET FILETYPE TO CDX
select 4
USE METE
x := "'9855564'"
cFilter := "me_serial = "+ x
bFilter = "{||"+cFilter+"}"
DBSETFILTER(&bFilter,cFilter)
DBGOTOP()
DEFINE WINDOW oChild FROM 4, 4 TO 25, 75 ;
TITLE "Meter Works"
oBrw := TXBrowse():New( oChild )
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLCELL
oBrw:nColDividerStyle := LINESTYLE_BLACK
oBrw:nRowDividerStyle := LINESTYLE_BLACK
oBrw:lColDividerComplete := .t.
oBrw:nHeaderLines := 1
oBrw:nFooterLines := 1
oBrw:nDataLines := 2
oBrw:lFooter := .t.
oBrw:SetRDD()
for nFor := 1 to Fcount()
if nFor=20
oBrw:aCols[ nFor ]:cHeader := FieldName( nFor )
oBrw:aCols[ nFor ]:cFooter := alltrim(STR(TOTALEM2(),12,0))
loop
endif
*oBrw:aCols[ nFor ]:cHeader := "Field: " + ltrim( str( nFor ) ) + CRLF + FieldName( nFor )
oBrw:aCols[ nFor ]:cHeader := FieldName( nFor )
oBrw:aCols[ nFor ]:cFooter := FieldName( nFor )
oBrw:aCols[ nFor ]:bRClickHeader := {|r,c,f,o| Msginfo("Right click on column header " + o:cHeader, "TXBrowse power") }
oBrw:aCols[ nFor ]:bLClickFooter := {|r,c,f,o| Msginfo("Left click on column footer " + o:cHeader, "TXBrowse power") }
oBrw:aCols[ nFor ]:bRClickFooter := {|r,c,f,o| Msginfo("Right click on column footer " + o:cHeader, "TXBrowse power") }
oBrw:aCols[ nFor ]:blDClickData := {|r,c,f,o| Msginfo("Left double click on column data " + o:cHeader, "TXBrowse power") }
oBrw:aCols[ nFor ]:bRClickData := {|r,c,f,o| Msginfo("Right click on column data " + o:cHeader, "TXBrowse power") }
next
oBrw:CreateFromCode()
oChild:oClient := oBrw
ACTIVATE WINDOW oChild MAXIMIZED ON INIT oBrw:SetFocus()
RETURN NIL
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot], Surasak and 31 guests