home *** CD-ROM | disk | FTP | other *** search
/ BUG 6 / BUGCD1997_09.BIN / UTIL / ADDZIP / ADDZIP.EXE / VB / SUPPORT.BAS < prev   
Encoding:
BASIC Source File  |  1997-06-01  |  1.4 KB  |  53 lines

  1. ' Support routines for addZIP Compression routines
  2. '
  3. '
  4.  
  5. Function GetAction(cFrom As String) As Integer
  6.     GetAction = Val(GetPiece(cFrom, "|", 2))
  7. End Function
  8.  
  9. Function GetFileCompressedSize(cFrom As String) As Long
  10.     GetFileCompressedSize = Val(GetPiece(cFrom, "|", 6))
  11. End Function
  12.  
  13. Function GetFileCompressionRatio(cFrom As String) As Integer
  14.     GetFileCompressionRatio = Val(GetPiece(cFrom, "|", 7))
  15. End Function
  16. Function GetPercentComplete(cFrom As String) As Integer
  17.     GetPercentComplete = Val(GetPiece(cFrom, "|", 7))
  18. End Function
  19.  
  20. Function GetFileName(cFrom As String) As String
  21.     GetFileName = GetPiece(cFrom, "|", 4)
  22. End Function
  23.  
  24. Function GetFileOriginalSize(cFrom As String) As Long
  25.     GetFileOriginalSize = Val(GetPiece(cFrom, "|", 5))
  26. End Function
  27.  
  28. Function GetPiece(from As String, delim As String, Index As Integer) As String
  29.     Dim temp$
  30.     Dim Count As Integer
  31.     Dim Where As Integer
  32.     '
  33.     temp$ = from & delim
  34.     Where = InStr(temp$, delim)
  35.     Count = 0
  36.     Do While (Where > 0)
  37.         Count = Count + 1
  38.         If (Count = Index) Then
  39.             GetPiece = Left$(temp$, Where - 1)
  40.             Exit Function
  41.         End If
  42.         temp$ = Right$(temp$, Len(temp$) - Where)
  43.         Where = InStr(temp$, delim)
  44.     Loop
  45.     If (Count = 0) Then
  46.         GetPiece = from
  47.     Else
  48.         GetPiece = ""
  49.     End If
  50. End Function
  51.  
  52.  
  53.