Have a small sample using a meter style xp ( tprogress) to index a file ?
on resource dialog ?
thanks
PROCEDURE NewIndex ()
LOCAL oFnt := SetFont ()
LOCAL oDlg, oMeter, oRadio, oSay, cSay := "Indiziere..."
LOCAL oOk, oClose
LOCAL nRadio
LOCAL nStart := 0, nTotal := 100
DEFINE DIALOG oDlg RESOURCE "INDEX" FONT oFnt
......
REDEFINE PMETER oMeter VAR nStart TOTAL nTotal ID 1000 OF oDlg FONT oFnt
REDEFINE BUTTON oOk ID 101 OF oDlg ACTION (oOk:disable(),;
oClose:disable(),;
BuildIdx (oMeter,oSay,,nRadio),;
oClose:SetText(OemToAnsi("Schließen")),;
oClose:enable() )
REDEFINE BUTTON oClose ID 102 OF oDlg ACTION ( oDlg:end() )
ACTIVATE DIALOG oDlg ON INIT dbCloseAll ()
oFnt:Release ()
OpenFiles ()
SetRela (0)
RETURN
#define idx_PROD 1
#define idx_LIEF 2
#define idx_KUND 3
#define idx_RECH 4
#define idx_RESE 5
#define idx_ANGE 6
//----------------------------------------------------------------//
STATIC PROCEDURE BuildIdx (oMeter,oText,lEnd, nRadio)
FIELD Datum, Plz, Beschr, Anbiet_Nr, Name, Vorname, Nr, Best_Nr, L_Nr
FIELD Firma, KundenNr, Anwendung, Ersatzart, Prod_Nr, Strasse
FIELD Hersteller,Art_name, ArtikelNr, Gruppe1, Gruppe2
FIELD I_Groesse, I_Speed, I_SpGr
FIELD K_Nummer, Intern1
LOCAL nTotal, nCount, nPos, nLast
LOCAL nChoice := nRadio
LOCAL lAll := (nChoice == 7)
LOCAL cExt := ORDBAGEXT ()
LOCAL aGrp := ReadTyp ()
LOCAL i := 1
LOCAL aIndex := {.f.,.f.,.f.,.f.,.f.,.f.}, nStart
IF lAll
nRadio--
FOR i := 1 TO nRadio
aIndex[i] := .T.
NEXT
nStart := 1
ELSE
aIndex[nRadio] := .T.
nStart := nRadio
ENDIF
lEnd:=.F.
CLOSE ALL // Alle Dateien schließen
FOR i := nStart TO nRadio
DO CASE
CASE aIndex[idx_PROD]
FErase ("Product"+cExt)
USE Product NEW
nLast := LastRec()
nPos := 0
oMeter:SetRange (0, nLast)
oMeter:Refresh()
nCount := INT (oMeter:nTotal / 100)
nCount := IIF (nCount < 1, 1, nCount)
oText:Varput ("Indiziere Produktdaten (1 von 42)"); oText:Refresh()//;nPos := 0
INDEX ON UPPER (SubStr(Hersteller,1,10))+SUBSTR(Gruppe2,1,3) TAG Herst ;
EVAL (oMeter:Set (RECNO()), SysRefresh(), !lEnd) EVERY nCount
....
oMeter:nTotal := 100
oMeter:Set(0)
oMeter:Refresh()
oText:Varput ("Indiziere..."); oText:Refresh()
CLOSE ALL
NEXT
RETURN
CONTROL "", 1000, "msctls_progress32", 0 | WS_CHILD | WS_VISIBLE, 9, 106, 136, 9
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 67 guests