Is it dangerous?

Is it dangerous?

Postby MarcoBoschi » Fri Apr 20, 2012 2: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: Select all  Expand view

field->code + IIF( EMPTY( field->date ) ,"99999999" , DTOS( field->date ) )
 

Are there any simplest solutions?

Best regards

marco
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Is it dangerous?

Postby hmpaquito » Fri Apr 20, 2012 5: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
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 107 guests