O.T. - xHarbour

O.T. - xHarbour

Postby MarioG » Thu Mar 21, 2013 10:35 am

Gente;
Ten una Help (chm y pdf) que dice ser versión 1.1
Alguien tiene una versión posterior?
Mi interés, por ahora, son los parámetros de la función HB_ZipFile()

gracias
Resistencia - "Ciudad de las Esculturas"
Chaco - Argentina
User avatar
MarioG
 
Posts: 1380
Joined: Fri Oct 14, 2005 1:28 pm
Location: Resistencia - Chaco - AR

Re: O.T. - xHarbour

Postby karinha » Thu Mar 21, 2013 1:45 pm

HB_ZIPFILE:HB_ZIPFILE()

Create a zip file

Syntax
HB_ZIPFILE( <cFile> , <cFileToCompress> | <aFiles>, <nLevel> ,
<bBlock>,<lOverWrite> ,<cPassword>,<lWithPath>,<lWithDrive>) ---> lCompress
Arguments
<cFile> Name of the zip file

<cFileToCompress> Name of a file to Compress, Drive and/or path can be used

<aFiles> An array containing files to compress, Drive and/or path can be used

<nLevel> Compression level ranging from 0 to 9

<bBlock> Code block to execute while compressing

<lOverWrite> Toggle to overwite the file if exists

<cPassword> Password to encrypt the files

<lWithPath> Toggle to store the path or not

<lWithDrive> Toggle to store the Drive letter and path or not
Returns
<lCompress> .t. if file was create, otherwise .f.

Description
This function creates a zip file named <cFile>. If the extension is ommited, .ZIP will be assumed. If the second parameter is a character string, this file will be added to the zip file. If the second parameter is an array, all file names contained in <aFiles> will be compressed.

If <nLevel> is used, it detemines the compression type where 0 means no compression and 9 means best compression.

If <bBlock> is used, every time the file is opened to compress it will evaluate bBlock. Parameters of bBlock are cFile and nPos.

If <lOverWrite> is used , it toggles to overwrite or not the existing file. Default is to overwrite the file,otherwise if <lOverWrite> is false the new files are added to the <cFile>.

If <cPassword> is used, all files that are added to the archive are encrypted with the password.

If <lWithPath> is used, it tells thats the path should also be stored with the file name. Default is false.

If <lWithDrive> is used, it tells thats the Drive and path should also be stored with the file name. Default is false.

Examples
Code: Select all  Expand view

FUNCTION MAIN()


      IF HB_ZIPFILE( "TEST.ZIP","TEST.PRG")
         qout("File was successly create")
      ENDIF

      IF HB_ZIPFILE( "TEST1.ZIP",{"TEST.PRG","c:\windows\win.ini"})
         qout("File was successly create")
      ENDIF

      IF HB_ZIPFILE( "TEST2.ZIP",{"TEST.PRG","c:\windows\win.ini"},8,{|nPos,cFile|,qout(cFile)})
         qout("File was successly create")
      ENDIF

      aFiles := {"TEST.PRG","c:\windows\win.ini"}
      nLen   := Len(afiles)
      aGauge := GaugeNew( 5, 5, 7,40 , "W/B", "W+/B" ,'²')
      GaugeDisplay( aGauge )
      Hb_ZIPFILE('test33.zip',aFiles,8,{|cFile,nPos| GaugeUpdate(aGauge,nPos/nLen)},,'hello')

Return Nil
 


Library is zlib.lib and zlib_bor.lib For Borland Compilers Library is zlib.lib zlib_ms.lib for MSVC compilers
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7351
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: O.T. - xHarbour

Postby karinha » Thu Mar 21, 2013 1:51 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7351
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: O.T. - xHarbour

Postby MarioG » Thu Mar 21, 2013 3:25 pm

Karinha, muchas gracias!

queda pendiente si alguien sabe como obtener una version actualizada de la Ayuda
Resistencia - "Ciudad de las Esculturas"
Chaco - Argentina
User avatar
MarioG
 
Posts: 1380
Joined: Fri Oct 14, 2005 1:28 pm
Location: Resistencia - Chaco - AR

Re: O.T. - xHarbour

Postby MarioG » Thu Mar 21, 2013 3:36 pm

Amplio pregunta;

1) la zlib_bor.lib, no la tengo. No obstante con la zlib sola e podido crear un ejecutable y comprime. Es determinante zlib_bor?

2) Mi intención es mostrar el avance mediante 2 meter. Uno que muestra el avance en bytes del archivo a comprimir/descomprimir y el segundo meter que muestra el avance segun archivo procesado/total de archivos a comprimir
Resistencia - "Ciudad de las Esculturas"
Chaco - Argentina
User avatar
MarioG
 
Posts: 1380
Joined: Fri Oct 14, 2005 1:28 pm
Location: Resistencia - Chaco - AR

Re: O.T. - xHarbour

Postby karinha » Thu Mar 21, 2013 5:10 pm

total de archivos a comprimir, muestra en una Listbox como en XBACKUP LITE By Carlos vargas.

zlib_bor.lib, también no la tengo

salu2
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7351
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 39 guests