home *** CD-ROM | disk | FTP | other *** search
/ Software Recommendations - 1998 Season 1 / DNBCD4.iso / develop / lib / addzip / ADDZIP.ZIP / VB / SUPPORT.BAS < prev   
Encoding:
BASIC Source File  |  1997-08-15  |  1.4 KB  |  54 lines

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