Backup & Restore Dbf Files

You can share your experience with HMG. Share with some screenshots/project details so that others will also be benefited.

Moderator: Rathinagiri

User avatar
andyglezl
Posts: 1161
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Has thanked: 35 times
Been thanked: 73 times
Contact:

Re: Backup & Restore Dbf Files

Post by andyglezl » Wed Jul 17, 2013 4:58 pm

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
-----------------------------------------------------------
Andrés González López
Desde Guadalajara, Jalisco. México.

User avatar
AidTIC
Posts: 93
Joined: Mon Apr 22, 2013 8:29 am
DBs Used: DBF
Been thanked: 3 times
Contact:

Post by AidTIC » Wed Jul 17, 2013 5:24 pm

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 :?:
Skydone Solutions
www.skydone.com

User avatar
andyglezl
Posts: 1161
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Has thanked: 35 times
Been thanked: 73 times
Contact:

Post by andyglezl » Wed Jul 17, 2013 7:20 pm

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
Andrés González López
Desde Guadalajara, Jalisco. México.

User avatar
AidTIC
Posts: 93
Joined: Mon Apr 22, 2013 8:29 am
DBs Used: DBF
Been thanked: 3 times
Contact:

Post by AidTIC » Thu Jul 18, 2013 8:13 am

Perfecto, todo ok

Gracias
Skydone Solutions
www.skydone.com

Post Reply