Progress - Create file ZIP

chelene30

New Member
Hello

I make a program for creating 2 files .txt.
I would like make a file .zip with this 2 files .txt.

I can create dile .zip but I don't find to link files .txt.

Please.

My Program :
/* Exportation File1.txt */
OUTPUT STREAM Article TO VALUE(gcNomFic1).
FOR EACH ttFile1 NO-LOCK :
PUT STREAM File1
ttFile1.Fields1 FORMAT 'x(15)'
ttFile1.Fields2 FORMAT 'x(30)'
ttFile1.Fields3 FORMAT "ZZZZ9.99"
ttFile1.Fields4 FORMAT "ZZZZZZZ9" SKIP.
END.
OUTPUT STREAM File1 CLOSE.
/* Exportation File2.txt */
OUTPUT STREAM File2 TO VALUE(gcNomFic2).
FOR EACH ttFile2 NO-LOCK :
PUT STREAM File2 ttFile2.Fields1 FORMAT 'x(15)'
ttFile2.Fields2 FORMAT 'X(15)' SKIP.
END.
OUTPUT STREAM File2 CLOSE.

/* Création du zip */
OUTPUT STREAM Zip TO VALUE(gcNomFicZip).

OUTPUT STREAM Zip CLOSE.
/* Ouverture du zip */
OS-COMMAND NO-WAIT VALUE("START " + gcNomFicZip).
 
def var ZipProg as char no-undo.

ZipProg = "pkzip". /* Or whatever zip program you are using */

os-command (ZipProg + " " + gcNomFicZip + " " + gcNomFic1 + " " + gcNomFic2).
 
Back
Top