Dear All,
I've used TMeter for index progress bar and it works in 16bits but I convert to 32bits now. I don't work properly. May I have an example for Index Progress Bar?
Thanks in advance,
Dutch
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg, oMtr
LOCAL nPos
USE TEST
DEFINE DIALOG oDlg
@ 1, 1 METER oMtr VAR nPos TOTAL LASTREC();
SIZE 100, 20
@ 3, 1 BUTTON "Start";
ACTION STARTINDEX( oMtr )
ACTIVATE DIALOG oDlg;
CENTER
CLOSE
RETURN NIL
STATIC FUNCTION STARTINDEX( oMtr )
INDEX ON FIELD -> last + FIELD -> first TO MTRTEST EVAL ( oMtr:Set( RECNO() ), oMtr:Refresh(), .T. )
MSGINFO( "Done!" )
RETURN NIL
FUNCtion CreateIndex( aNtxKey )
LOCAL nCnt, lUnique
#define ADS_ABORT .t.
#define ADS_CONTINUE .f.
oNtxMeter:nTotal:=100 //LastRec()
ADSRegCallBack({|nPercent| progress(nPercent,cNtxName)})
FOR nCnt := 1 TO LEN( aNtxKey )
cNtxKey := aNtxKey[ nCnt, 1 ]
cNtxName := aNtxKey[ nCnt, 2 ]
cNtxFor := ""
if len(aNtxKey[nCnt]) > 3
cNtxFor := aNtxKey[ nCnt, 4 ]
endif
lUnique := if( LEN( aNtxKey[ nCnt ] ) > 2, aNtxKey[ nCnt, 3 ], FALSE )
oSayText:bGet := { || "Re-building ... " + UPPER( cNtxName ) + ".NTX" }
oSayText:Refresh()
oNtxMeter:Set(0)
oNtxMeter:display()
CursorWait()
IF lUnique
/*
if lExclDel
INDEX ON &( cNtxKey ) TO ( cNtxName ) UNIQUE for !deleted() ;
EVAL ( oNtxMeter:Set( Recno() ), SysRefresh(), .T. )
else
*/
INDEX ON &( cNtxKey ) TO ( cNtxName ) UNIQUE
//EVAL ( oNtxMeter:Set( Recno() ), SysRefresh(), .T. )
// ADS doesn't recognize eval..every
*endif
ELSE
if empty(cNtxFor)
INDEX ON &( cNtxKey ) TO ( cNtxName )
//EVAL ( oNtxMeter:Set( Recno() ), SysRefresh(), .T. )
else
INDEX ON &( cNtxKey ) TO ( cNtxName ) for &(cNtxFor)
//EVAL ( oNtxMeter:Set( Recno() ), SysRefresh(), .T. )
endif
ENDIF
NEXT
ADSClrCallBack()
RETURN (Nil)
//-------------------------------------------------------------------------
static function progress(nPercent,CurrentNtx)
static cNtx
if cNtx==nil
cNtx := ""
endif
if empty(cNtx)
cNtx := currentNtx
elseif cNtx != CurrentNtx
cNtx := currentNtx
oNtxMeter:Set(100)
oNtxMeter:display()
endif
oNtxMeter:Set( nPercent )
oNtxMeter:display()
return ADS_CONTINUE
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 52 guests