FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour A problem xBrowse seek on DATE and NUMERIC ?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
A problem xBrowse seek on DATE and NUMERIC ?
Posted: Mon Jan 16, 2017 06:39 PM
Mr. Rao,

You posted :

Please go to METHOD AdoIncrSeek and locate the following line:

do case
case cType == 'C'

Change it as

do case
case cType == 'C' .or. uVal == nil

Well with this modification incremental filters on numeric and date columns may fail.

In my tests, DATE and NUMERIC - seek is not working
The first browse uses the new seekbar. the second the old fashion way.
CHARACTER and LOGICAL is working normal.
With NUMERIC and DATE the colums are sorted but the seek doesn't work.
( I can include this test for DOWNLOAD if needed )

The tested INDEX-builds :

USE CUSTOMER
ORDCREATE( ,"CUST1","UPPER(FIRST)", {|| UPPER(FIRST) } , .F. )
ORDCREATE( ,"CUST2","UPPER(LAST)", {|| UPPER(LAST) } , .F. )
ORDCREATE( ,"CUST3","DTOS(HIREDATE)", {|| DTOS(HIREDATE) } , .F. )
//ORDCREATE( ,"CUST3","DTOC(HIREDATE)", {|| DTOC(HIREDATE) } , .F. )
//ORDCREATE( ,"CUST3","HIREDATE", {|| HIREDATE } , .F. )
ORDCREATE( ,"CUST4","MARRIED", {|| MARRIED } , .F. )
ORDCREATE( ,"CUST5","STR(SALARY)", {|| STR(SALARY) } , .F. )
//ORDCREATE( ,"CUST5","SALARY", {|| SALARY } , .F. )




failed on DATE and NUMERIC



Any idea ?

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: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: A problem xBrowse seek on DATE and NUMERIC ?
Posted: Tue Jan 17, 2017 03:00 AM

Numerics and dates are sorted in the order of the values, not as character values.
So the seeks can not be on the initial characters as they appear in the browse.

Numerics: Seek to the value next higher than the value entered.
Dates: Seeks to the value next higher than the value in YYYYMMDD format

Regards



G. N. Rao.

Hyderabad, India
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: A problem xBrowse seek on DATE and NUMERIC ?
Posted: Fri Jan 27, 2017 03:24 PM
Mr. Rao,

it seems, there is still another problem

both defined ( edit and seek ) doesn't work and is showing a funny effect.

Code (fw): Select all Collapse
WITH OBJECT oBrw1
     ....
     ....
     :nEditTypes := EDIT_GET
     ....
     ....
     :lSeekBar := .t.
     ....
END




something must be changed ?

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: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: A problem xBrowse seek on DATE and NUMERIC ?
Posted: Fri Jan 27, 2017 06:18 PM
Mr Uwe

You are right.

Please make these corrections in the Method Edit( nKey ) of TXBrwColumn:
Replace Line 13089 of FWH1701 ( line 13007 of FWH1612 )
Code (fw): Select all Collapse
   nRow    := ( ( ::oBrw:nRowSel - 1 ) * ::oBrw:nRowHeight ) + ::oBrw:HeaderHeight()

with
Code (fw): Select all Collapse
   nRow    := ( ( ::oBrw:nRowSel - 1 ) * ::oBrw:nRowHeight ) + ::oBrw:FirstRow()


Also replace line 13135 (FWH1701) / line 13053 (FWH1612)
Code (fw): Select all Collapse
   nRow    := ( ( ::oBrw:nRowSel - 1  ) * ::oBrw:nRowHeight ) + ::oBrw:HeaderHeight() + 2

with
Code (fw): Select all Collapse
   nRow    := ( ( ::oBrw:nRowSel - 1  ) * ::oBrw:nRowHeight ) + ::oBrw:FirstRow() + 2
Regards



G. N. Rao.

Hyderabad, India
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: A problem xBrowse seek on DATE and NUMERIC ?
Posted: Sat Jan 28, 2017 08:34 PM
Mr. Rao,

thank You very much.
With these changes it works fine.



I still noticed another problem
A defined header-image for logical fields is not shown.
Instead a checkbox is displayed.
With all other fieldtyps it is working.
In my sample I'm testing a index on ALL fieldtypes



WITH OBJECT oBrw1:Married
:AddBmpFile( "Sort.bmp" ) // Index-image
:nHeadBmpNo := 1
END

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: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: A problem xBrowse seek on DATE and NUMERIC ?
Posted: Sun Jan 29, 2017 02:32 AM

SetCheck() adds to 2 bitmaps the the column.
After that the bitmap ("sort.bmp") you added is the 3rd bitmap.
So you should use
:nHeadBmpNo := 3

Method AddBitmap( <bmpfile/resource/array> ) superceded obsolete methods AddBmpFile() and AddResource() from FWH 10.01

:nHeadBmpNo := :AddBitmap( "sort.bmp" )

Regards



G. N. Rao.

Hyderabad, India
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: A problem xBrowse seek on DATE and NUMERIC ?
Posted: Sun Jan 29, 2017 10:16 AM
Thank You very much.
Now everything of my test is working



before adding a download, I will do some code cleaning ( and maybe adding some useful things )

I added Your expositions to the code like

oBrw1:SetCheck() // Default FWH Bitmap is Alpha
/*
SetCheck() adds to 2 bitmaps to the column.
After that the bitmap ("sort.bmp") you added is the 3rd bitmap.
So you should use
:nHeadBmpNo := 3
Method AddBitmap( <bmpfile/resource/array> ) superceded obsolete methods AddBmpFile()
and AddResource() from FWH 10.01
:nHeadBmpNo := :AddBitmap( "sort.bmp" )
*/


as well a readme.txt for the xbrowse-changes is included

Please make these corrections in the Method Edit( nKey ) of TXBrwColumn:
Replace Line 13089 of FWH1701 ( line 13007 of FWH1612 )

nRow := ( ( ::nRowSel - 1 ) * ::nRowHeight ) + ::HeaderHeight()
with
nRow := ( ( ::nRowSel - 1 ) * ::nRowHeight ) + ::FirstRow()

Also replace line 13135 (FWH1701) / line 13053 (FWH1612)
nRow := ( ( ::nRowSel - 1 ) * ::nRowHeight ) + ::HeaderHeight() + 2
with
nRow := ( ( ::nRowSel - 1 ) * ::nRowHeight ) + ::FirstRow() + 2


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.

Continue the discussion