FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour A easy way, to do incremental seek on numeric fields ?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
A easy way, to do incremental seek on numeric fields ?
Posted: Fri Apr 11, 2008 10:46 AM

Hello,

In a old program of mine, there is a index on
numeric Customer-Numbers ( CDX ).

The index is => Index on STR(number)
index on LTRIM(STR(number)) doesn't work.

When you do a seek on this field ( N 5 0 )
as a sample you seek < 5 > you have to do - - - - 5
4 blanks + "5"

Must i write a function for this ?

Regards

Uwe :lol:

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: 946
Joined: Thu Oct 06, 2005 07:05 PM
Re: A easy way, to do incremental seek on numeric fields ?
Posted: Fri Apr 11, 2008 10:51 AM

Uwe

Index on numeric work fine

index on number to ....

and then seek 5 or whatever else

no problem with it, i have many numeric indexs in my app

Richard

http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
Posts: 312
Joined: Sat Oct 08, 2005 09:12 AM
A easy way, to do incremental seek on numeric fields ?
Posted: Fri Apr 11, 2008 10:53 AM
Uwe,

index on LTRIM(STR(number)) doesn't work.

this is normal because all index keys need to be of constant same length.

Moreover it's a bad design to use numeric fields for indexing.
They are better used for numeric operation / calculation.

If you can't avoid it i'd take 'strzero( nVal, nLen, nDec )' for indexing and searching.

Regards,
Detlef
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Seek on numeric fields
Posted: Fri Apr 11, 2008 11:01 AM

Detlef Thank you,

Yes it is a very old application and
to much work to change it.

I will try Strzero

Regards

Uwe :lol:

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