home *** CD-ROM | disk | FTP | other *** search
/ Chip Hitware 3 / Chip_Hitware_Vol_03.iso / chiphit3 / win95 / tool / zipserv / ddezip.ba_ / ddezip.ba
Text File  |  1995-01-29  |  3KB  |  69 lines

  1.     'DDELabel.Caption holds the request and must be formatted as:
  2.     '  fixed length string, 100 long, the path and name of the ZIP file
  3.     '  1 character long string, value 0 - Zip, 1 - Unzip
  4.     '  fixed lenght string, 100 long,
  5.     '       the path and name (wild characters) of the files to Zip
  6.     '       or
  7.     '       the destination path of the files to unzip
  8.     '  one character
  9.     '       0 or 1 if not zero that keeps the date at zipping, overwrites at unzipping
  10.     '  one character
  11.     '       0 or 1 if not zero that stores the path at zipping, restores the path at unzipping
  12. Type ZipInfoVar
  13.    ZipFile     As String
  14.    Task        As Integer
  15.    Destination As String
  16.    FilesToZip  As String
  17.    KeepDate    As Integer
  18.    Overwrite   As Integer
  19.    StorePath   As Integer
  20.    Recursive   As Integer
  21.    RestorePath As Integer
  22.    Comment     As String
  23.    Password    As String
  24. End Type
  25. Global ZipInfo As ZipInfoVar
  26.  
  27. Sub GetZipInfo (s$)
  28.     ZipInfo.ZipFile = Trim(Left$(s$, 100))
  29.     ZipInfo.Task = Val(Mid$(s$, 101, 1))
  30.     If ZipInfo.Task = 0 Then
  31.        ZipInfo.FilesToZip = Trim(Mid$(s$, 102, 100))
  32.        ZipInfo.KeepDate = Val(Mid$(s$, 202, 1))
  33.        ZipInfo.KeepDate = IIf(ZipInfo.KeepDate = 0, False, True)
  34.        ZipInfo.StorePath = Val(Mid$(s$, 203, 1))
  35.        ZipInfo.Recursive = Val(Mid$(s$, 204, 1))
  36.        ZipInfo.StorePath = IIf(ZipInfo.StorePath = 0, False, True)
  37.     Else
  38.        ZipInfo.Destination = Trim(Mid$(s$, 102, 100))
  39.        ZipInfo.Overwrite = Val(Mid$(s$, 202, 1))
  40.        ZipInfo.Overwrite = IIf(ZipInfo.Overwrite = 0, False, True)
  41.        ZipInfo.RestorePath = Val(Mid$(s$, 203, 1))
  42.        ZipInfo.RestorePath = IIf(ZipInfo.RestorePath = 0, False, True)
  43.     End If
  44.     ZipInfo.Comment = Trim(Mid$(s$, 204, 50))
  45.     ZipInfo.Password = Trim(Mid$(s$, 254, 10))
  46. End Sub
  47.  
  48. Function ZipPass$ ()
  49.     Dim s$
  50.     s$ = ""
  51.     s$ = s$ + Left$(ZipInfo.ZipFile + String$(100, " "), 100)
  52.     s$ = s$ + IIf(ZipInfo.Task = 0, "0", "1")
  53.     If ZipInfo.Task = 0 Then
  54.        s$ = s$ + Left$(ZipInfo.FilesToZip + String$(100, " "), 100)
  55.        ZipInfo.KeepDate = Val(Mid$(s$, 202, 1))
  56.        s$ = s$ + IIf(ZipInfo.KeepDate = 0, "0", "1")
  57.        s$ = s$ + IIf(ZipInfo.StorePath = 0, "0", "1")
  58.        s$ = s$ + IIf(ZipInfo.Recursive = 0, "0", "1")
  59.     Else
  60.        s$ = s$ + Left$(ZipInfo.Destination + String$(100, " "), 100)
  61.        s$ = s$ + IIf(ZipInfo.Overwrite = 0, "0", "1")
  62.        s$ = s$ + IIf(ZipInfo.RestorePath = 0, "0", "1")
  63.     End If
  64.     s$ = s$ + Left$(ZipInfo.Comment + String$(50, " "), 50)
  65.     s$ = s$ + Left$(ZipInfo.Password + String$(10, " "), 10)
  66.     ZipPass$ = s$
  67. End Function
  68.  
  69.