Page 1 of 1

Problem with progress bar.

Posted: Mon Jul 07, 2008 6:28 am
by HunterEC
The following code display a progress bar for a couple of thousand records. Using it on a file with over 8,000,000 (8 million) records it only displays the message "Please, wait" with no progress bar. What is wrong with it ? Thank you.


PROCEDURE Main
request SIX
rddRegister( "SIX", 1 )
rddsetdefault( "SIX" )
SET FILETYPE TO CDX

USE Customer

MsgMeter( { | oMeter, oText, oDlg, lEnd | ;
CreateTag( oMeter, oText, oDlg, @lEnd , "Number", "Cust_no",
"! EMPTY(Cust_no)") }, "Sales Maintenance..." )

CLOSE DATABASES
RETURN



STATIC PROCEDURE CreateTag (oMeter, oText, oDlg, lEnd, cTagName,
cKey, cCondition, lDescend)

MEMVAR cKeyField, cForCond

PRIVATE cKeyField, cForCond

IF VALTYPE(lDescend) != "L"
lDescend := .F.
ENDIF
cKeyField := cKey

oMeter:nTotal = RecCount()

IF cCondition != NIL
cForCond := cCondition
IF ! lDescend
INDEX ON &cKeyField TAG (cTagName) FOR &cForCond ;
EVAL ( oMeter:Set( RecNo() ), SysRefresh(), ! lEnd )
ELSE
INDEX ON &cKeyField TAG (cTagName) FOR &cForCond ;
EVAL ( oMeter:Set( RecNo() ), SysRefresh(), ! lEnd ) ;
DESCENDING
ENDIF
ELSE
IF ! lDescend
INDEX ON &cKeyField TAG (cTagName) ;
EVAL ( oMeter:Set( RecNo()), SysRefresh(), ! lEnd ) ;
ELSE
INDEX ON &cKeyField TAG (cTagName)
EVAL ( oMeter:Set( RecNo() ), SysRefresh(), ! lEnd ) ;
DESCENDING
ENDIF
ENDIF
RETURN