FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour PROBLEMAS CON ADS Y MSGMETER
Posts: 30
Joined: Thu Oct 25, 2007 07:54 PM
PROBLEMAS CON ADS Y MSGMETER
Posted: Wed Feb 06, 2008 05:35 PM
Tengo una aplicacion que funciona con DBFCDX, al pasarla a ADS tengo un problema visual para saber que porporción lleva de indice con MSGMETER


*****************************************
*la parte del codigo que llama a ADS está correcta
*OJO FUNCIONA PERFECTAMENTE CON DBFCDX
*****************************************
USE clientes NEW
INDEXA("PROCESANDO CODIGO EMPRESA","CODIGO","CODIGO")
RETURN NIL

function indexa(TITULO,CAMPO,TAGCDX)
MsgMeter( { | oMeter, oText, oDlg, lEnd | ;
BuildIndex( oMeter, oText, oDlg, @lEnd ,;
CAMPO, TAGCDX ) } ,;
OemToAnsi(TITULO) ,;
OemToAnsi("Procesando ¡ndices") )
RETURN NIL

FUNCTION BuildIndex( oMeter, oText, oDlg, lEnd, campo, ARCHIVO )
oMeter:nTotal = LASTREC()
OrdSetFocus(0)
INDEX ON &(Campo) TAG &(ARCHIVO) ;
EVAL ( oMeter:Set( RecNo() ), MSGINFO(RECNO()), oMeter:REFRESH() ,ODLG:REFRESH(),SysRefresh(), ! lEnd )
RETURN NIL
***********************************

Dicho código con DBFCDX me informa perfectamente del la proporcion del indice que lleva efectuada.... pero en cambio con ADS no me aparece absolutamente nada. Mi pregunta es ADS entiende?
INDEX ON &(Campo) TAG &(ARCHIVO) ;
EVAL ( oMeter:Set( RecNo() ), MSGINFO(RECNO()), oMeter:REFRESH() ,ODLG:REFRESH(),SysRefresh(), ! lEnd )
Posts: 1789
Joined: Tue Oct 11, 2005 05:01 PM
PROBLEMAS CON ADS Y MSGMETER
Posted: Wed Feb 06, 2008 09:45 PM
ADS no permitre el uso de EVAL, simplemete lo ignora.
Existe una forma de saber el avance del proceso de la indexacion con ADS.

tomado del doc de rddads
       FUNCTION Main()
          ...
          AdsRegCallBack( {|nPercent| outputstuff(nPercent)}  )
          /* The above codeblock will be called approximately
               every 2 seconds while indexing.
               The codeblock can return .T. to abort.   */
          INDEX ON First+LAST+LABEL1+LABEL2 TAG First
          AdsClrCallBack()
          ...
       RETURN nil

       FUNCTION outputstuff(nPercent)  /* The "callback" function */
          ? "output stuff", nPercent
       RETURN inkey() == 27

       /*  If press ESC, returns .T. to abort.   */
Salu2

Carlos Vargas

Desde Managua, Nicaragua (CA)
Posts: 30
Joined: Thu Oct 25, 2007 07:54 PM
PROBLEMAS CON ADS Y MSGMETER
Posted: Thu Feb 07, 2008 12:37 PM

SOLUCIONADO

MUCHA, MUCHISIMAS GRACIAS

Posts: 248
Joined: Wed Jan 11, 2006 11:30 AM
PROBLEMAS CON ADS Y MSGMETER
Posted: Thu May 01, 2008 05:32 PM
No consigo criar los indecis com ADS e msgmeter :

 REQUEST ADS , ADSKeyno, ADSKeycount, AdsGetRelKeyPos, AdsSetRelKeyPos

FUNCTION MAIN()

 RddRegister( "ADS", 1 )
 RddSetDefault( "ADS" )
 AdsLocking( .T. )
 AdsRightsCheck( .F. )
 AdsSetFileType( 2 ) /// 1 NTX / 2 CDX / 3 ADT
 AdsSetServerType(2) /// 1 Local / 2 Server / 7 AIS Internet
 AdsSetDateFormat("DD/MM/YYYY")
 AdsSetEpoch("01/01/2000")
 AdsTestRecLocks(.T.)
 ADSCACHEOPENTABLES(40)

  Use "&cCamServDados\PDN_SP.Dbf" New 
  
  MsgMeter( { | oMeter, oText, oDlg, lEnd | ;
             BuildIndex( oMeter, oText, oDlg, @lEnd ) },;
             "Building the Index..." ) 
  use


Function BuildIndex( oMeter, oText, oDlg, lEnd )

   AdsRegCallBack( {|nPercent| outputstuff(nPercent),SysRefresh(),.t.} ) 
   Index on NM TAG 1 To "&cCamServDados\iPDN_SP.Dbf"
   
   AdsClrCallBack()

return nil
//----------------------------------------------------------------------------//
FUNCTION outputstuff(nPercent)  /* The "callback" function */ 
          ? "output stuff", nPercent 
       RETURN inkey() == 27


Erro.Log
 Error description: Error ADSCDX/7089  Erro de cria‡Æo: C:\Prog_Fwh\FwH804_xHb100\Bn_Dbf\SB_Dados\iPDN_SP.Dbf


Oque esta errado ???

Saludos Ale
aleseribeli@hotmail.com

FwH, Hb Svn, ADS 8.1, ADS 10, Pelles C, FwPPC, MsVc 2008, MsVc 2010
"Conhecimento, você não subtrai quando divide; mas soma e multiplica."
**---Mário Persona---**

Continue the discussion