TO ANTONIO :progress error

TO ANTONIO :progress error

Postby Silvio » Fri Jul 10, 2009 9:56 am

I want use progress bar to index a dbf

I made :

SELECT 1
USE ( CurDir() + "\CLIENTES" ) VIA "DBFCDX" ALIAS CLIENTES NEW

MsgMeter( { | oMeter, oText, oDlg, lEnd | ;
BuildIndex( oMeter, oText, oDlg, @lEnd, "Clientes->Nombre", "Cliname" ) },;
"Indexando Apuntes por Fecha...", "Espere un momento" )

.....



STATIC FUNCTION BuildIndex( oMeter, oText, oDlg, lEnd, campo, bolsa )
oMeter:nTotal = RecCount()
OrdSetFocus(0)
INDEX ON &(Campo) TAG &(Bolsa) ;
EVAL ( oMeter:Set( RecNo() ), SysRefresh(), ! lEnd )
RETURN NIL


function MsgMeter( bAction, cMsg, cTitle )

local oDlg, oMeter, oText, oBtn, oFont
local lEnd := .f., lCancel := .f.
local nVal := 5

DEFAULT bAction := { || nil },;
cMsg := "Processing...", cTitle := "Please, wait"

DEFINE FONT oFont NAME GetSysFont() SIZE 0, -8

DEFINE DIALOG oDlg FROM 5, 5 TO 13, 45 TITLE cTitle FONT oFont

@ 0.2, 0.5 SAY oText VAR cMsg SIZE 130, 10 OF oDlg

@ 1, 0.5 PROGRESS oMeter SIZE 150, 10 OF oDlg

oMeter:nPosition = nVal


@ 2.2, 10.4 BUTTON oBtn PROMPT "&Cancel" OF oDlg ;
ACTION ( lEnd:= .t., lCancel:= .t. ) SIZE 32, 11

// This block gets evaluated only the first time the DialogBox is painted !!!
oDlg:bStart = { || Eval( bAction, oMeter, oText, oDlg, @lEnd, oBtn ),;
lEnd := .t., oDlg:End() }

ACTIVATE DIALOG oDlg CENTERED ;
VALID lEnd

oFont:End()

return lCancel



--------------------------------------------------------------------------


wherei s the error?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: TO ANTONIO :progress error

Postby Antonio Linares » Fri Jul 10, 2009 1:59 pm

Silvio,

Please review this working example:
viewtopic.php?p=63307#p63307
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42100
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin para Pocket PC

Who is online

Users browsing this forum: No registered users and 28 guests