FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Is it dangerous?
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM

Is it dangerous?

Posted: Fri Apr 20, 2012 02:44 PM
A dbf table indexed by this index key

INDEX ON field->code + IIF( EMPTY( field->date ) ,"99999999" , DTOS( field->date ) ) TAG MYTAG TO mytable FOR !DELETED()

In a filtered tcbrowse

ordscope( 0 , cCode )
ordscope( 1 , cCode )

In order to obtain that when user want to append a new record

IF add_rec( )
REPLACE field->code WITH cCode
Stabilizza( oBrw )
ENDIF

this new record does not skip at the top. It remains at the bottom until I insert the date (90% more recent date that last inserted
Is it dangerous this indexkey?
Code (fw): Select all Collapse
field->code + IIF( EMPTY( field->date ) ,"99999999" , DTOS( field->date ) )

Are there any simplest solutions?

Best regards

marco
Marco Boschi
info@marcoboschi.it
Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM

Re: Is it dangerous?

Posted: Fri Apr 20, 2012 05:24 PM

IMHO,

That index is NOT dangerous.

A index expression "only" returns a key value.

In your case, sometimes returns 99999999.

Perfectly compatible.

Regards

Continue the discussion