IndexMeter ( { | oMeter, oText, oDlg, lEnd | BuildTag( oMeter, oText, oDlg, @lEnd, "TEST",;
"UserId", "Id", "! EMPTY(Id)", {|| ! EMPTY(Id) } ) }, ;
"Mantenimiento ...", "Un Momento Por Favor ..." )
FUNCTION IndexMeter ( bAction, cMsg, cTitle )
LOCAL oDlg, oMeter, oText, lEnd := .F., nVal := 0
DEFAULT bAction := { || nil }, cMsg := "Processing...", cTitle := ""
DEFINE DIALOG oDlg FROM 5, 5 TO 11, 65 TITLE cTitle ;
STYLE nOr( WS_POPUP,WS_CAPTION,WS_THICKFRAME )
@ 0.2, 0.5 SAY oText VAR cMsg SIZE 130, 10 OF oDlg
@ 1, 0.5 METER oMeter VAR nVal SIZE 150, 10 OF oDlg
* @ 2.5, 9.5 BUTTON "&Cancel" OF oDlg SIZE 32, 13 ACTION lEnd := .t.
// This block gets evaluated only the first time the DialogBox is painted !!!
oDlg:bStart := { || Eval( bAction, oMeter, oText, oDlg, @lEnd ), lEnd := .T., oDlg:End() }
ACTIVATE DIALOG oDlg CENTERED VALID lEnd
RETURN (NIL)
PROCEDURE BuildTag (oMeter, oText, oDlg, lEnd, cOrderBag, cTagName, cKey, cForCond,;
bForCond, lDescend)
DEFAULT lDescend TO .F.
DEFAULT cOrderBag TO ALIAS()
DEFAULT cForCond TO ".T."
DEFAULT bForCond TO {|| .T.}
oMeter:nTotal := LASTREC()
ORDSETFOCUS(0)
DBGOTOP()
ORDCONDSET(cForCond, bForCond, , , {|| ( oMeter:Set( RECNO() ), SysRefresh(), ! lEnd )}, ;
, RECNO(), , , , lDescend)
ORDCREATE(cOrderBag, cTagName, cKey)
RETURN