by dutch » Thu Jul 27, 2006 3:36 pm
Dear Detlef,
This is my index file procedure. I found this error has occur after I add TSbrowse.lib in my program. When I do not include Tsbrowse.ch and do not call TSbrowse the index run fine. I don't know why does it append?
Regards,
Dutch
*--------------*
Procedure IndexCheck(IndexAll)
OPENFILE('CCRIND','DX')
DX->(DbGotop())
do while !DX->(eof())
if ((!file(rtrim(DX->IND_DBF)+'.CDX').or.IndexAll) .and. !empty(DX->IND_NTX) .and. file(MEMVAR->cFoPath+rtrim(DX->IND_DBF)+'.DBF'))
cDbf := upper(rtrim(DX->IND_DBF))
OPENFILE(cDBF,,,.F.)
do while upper(rtrim(DX->IND_DBF)) == cDBF
cNtx := rtrim(DX->IND_NTX)
cExp := rtrim(DX->IND_EXP)
lAsend := iif(DX->IND_SORT='D',.F.,.T.)
if IndexAll .and. dow(date()) = 1
pack
end
MsgMeter( { | oMeter, oText, oDlg, lEnd | ;
BuildIndex( oMeter, oText, oDlg, @lEnd, cNtx, cExp, lAsend ) },;
"Indexing TAG "+cNtx,'Building index file, Please wait..' )
DX->(dbskip())
if !(upper(rtrim(DX->IND_DBF)) == cDBF)
DX->(dbskip(-1))
exit
end
end
CLOSEFILE(cDbf)
SELECT('DX')
end
DX->(dbskip())
end
CLOSEFILE('DX')
select(old_sel)
return
*----------------------------------------------*
Static Function BuildIndex( oMeter, oText, oDlg, lEnd, cNtx, cExp, lAsend )
oMeter:nTotal := Int(LastRec()/10)
if lAsend
INDEX ON &cExp TAG &cNtx ;
EVAL ( oMeter:Set( int(RecNo()/10) ), SysRefresh(), !lEnd ) ;
EVERY Int(Lastrec()/10)
else
INDEX ON &cExp TAG &cNtx ;
EVAL ( oMeter:Set( int(RecNo()/10) ), SysRefresh(), !lEnd ) ;
EVERY Int(Lastrec()/10) ;
DESCENDING
end
return nil