Page 5 of 5

Re: Backup & Restore Dbf Files

Posted: Wed Jul 17, 2013 4:58 pm
by andyglezl
Hola AidTIC

Mencionas:
...pero no consigo que termine el programa...
No termina tu programa o no se llena el ProgressBar ?
Te falta lo siguiente, antes de COMPRESS

Code: Select all

     nLen=len(afiles)
     Form_Main.Progress_1.RangeMin := 0
     Form_Main.Progress_1.RangeMax := nLen

     COMPRESS afiles ;
     TO 'ZipTest.Zip' ;
     BLOCK {|cFile,nPos| ProgressUpdate( nPos , cFile ) } ;
     OVERWRITE
-----------------------------------------------------------
Hello AidTIC

You mention:
... but can not get the program ends ...
Do not finish your program or not filled the ProgressBar?

Put the following before COMPRESS

Code: Select all

 nLen=len(afiles)
     Form_Main.Progress_1.RangeMin := 0
     Form_Main.Progress_1.RangeMax := nLen

     COMPRESS afiles ;
     TO 'ZipTest.Zip' ;
     BLOCK {|cFile,nPos| ProgressUpdate( nPos , cFile ) } ;
     OVERWRITE
-----------------------------------------------------------

Re: Backup & Restore Dbf Files

Posted: Wed Jul 17, 2013 5:24 pm
by AidTIC
Le he añadido las Lineas ...

nLen=len(afiles)
Form_Main.Progress_1.RangeMin := 0
Form_Main.Progress_1.RangeMax := nLen

Y acaba el ProgressBar ..... :D

Pero el boton de aceptar siempre eta activo :?:

Re: Backup & Restore Dbf Files

Posted: Wed Jul 17, 2013 7:20 pm
by andyglezl
Puedes utilizar la propiedad VISIBLE o ENABLED

Code: Select all


@ 120,120 LABEL label_1 VALUE ''

DEFINE BUTTON Boton_Ac
ROW 170
COL 100
WIDTH 150
HEIGHT 48
CAPTION ' Aceptar '
FONTNAME "Arial"
FONTSIZE 18
FONTBOLD .T.
ONCLICK form_1.Release // Iif (MsgOkCancel ("Desea Enviar Los Ficheros?", "Envio de Ficheros") , MainCreateZip() , Win_ENLA.Release)
HELPID "Aceptar"
VISIBLE .T.         <---------------- Pon VISIBLE  .F.
END BUTTON
form_1.Boton_Ac.Enabled := .f.     <------ o mueve esta linea aqui

END WINDOW

form_1.center
form_1.activate
Y en:

Code: Select all

*------------------------------------------------------------------------------*
Function CreateZip()
*------------------------------------------------------------------------------*
local aDir:=Directory("Enlace\*.DBF")
local afiles:={}
Local x
local nLen

For x:=1 to len(aDir)
aadd(afiles,"Enlace\"+adir[x,1])
next

COMPRESS afiles ;
TO 'ZipTest.Zip' ;
BLOCK {|cFile,nPos| ProgressUpdate( nPos , cFile ) } ;
OVERWRITE

form_1.Boton_Ac.Visible := .T.       <----------- Añadir
form_1.Boton_Ac.Enabled := .T.
Return nil

Re: Backup & Restore Dbf Files

Posted: Thu Jul 18, 2013 8:13 am
by AidTIC
Perfecto, todo ok

Gracias