home *** CD-ROM | disk | FTP | other *** search
/ BUG 6 / BUGCD1997_09.BIN / UTIL / ADDZIP / ADDZIP.EXE / VB / ZIPWIZ / WIZARD.BAS < prev    next >
Encoding:
BASIC Source File  |  1997-06-01  |  1.7 KB  |  61 lines

  1. Attribute VB_Name = "Module2"
  2. #If Win16 Then
  3. Declare Function GetDriveType Lib "Kernel" (ByVal nDrive As Integer) As Integer
  4. #Else
  5. Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Long
  6. #End If
  7. Public Const DRIVE_REMOVABLE = 2
  8.  
  9. Function GetAction(cFrom As String) As String
  10.     GetAction = GetPiece(cFrom, "|", 2)
  11. End Function
  12.  
  13. Function GetFileCompressedSize(cFrom As String) As Long
  14.     GetFileCompressedSize = Val(GetPiece(cFrom, "|", 7))
  15. End Function
  16.  
  17. Function GetFileCompressionRatio(cFrom As String) As Integer
  18.     GetFileCompressionRatio = Val(GetPiece(cFrom, "|", 8))
  19. End Function
  20. Function GetPercentComplete(cFrom As String) As Integer
  21.     GetPercentComplete = Val(GetPiece(cFrom, "|", 8))
  22. End Function
  23.  
  24. Function GetFileName(cFrom As String) As String
  25.     GetFileName = GetPiece(cFrom, "|", 5)
  26. End Function
  27.  
  28. Function GetFileOriginalSize(cFrom As String) As Long
  29.     GetFileOriginalSize = Val(GetPiece(cFrom, "|", 6))
  30.     Debug.Print Val(GetPiece(cFrom, "|", 6))
  31. End Function
  32.  
  33. Function GetFilePath(cFrom As String) As String
  34.     GetFilePath = GetPiece(cFrom, "|", 4)
  35. End Function
  36. Function GetPiece(from As String, delim As String, Index As Integer) As String
  37.     Dim temp$
  38.     Dim Count As Integer
  39.     Dim Where As Integer
  40.     '
  41.     temp$ = from & delim
  42.     Where = InStr(temp$, delim)
  43.     Count = 0
  44.     Do While (Where > 0)
  45.         Count = Count + 1
  46.         If (Count = Index) Then
  47.             GetPiece = Left$(temp$, Where - 1)
  48.             Exit Function
  49.         End If
  50.         temp$ = Right$(temp$, Len(temp$) - Where)
  51.         Where = InStr(temp$, delim)
  52.     Loop
  53.     If (Count = 0) Then
  54.         GetPiece = from
  55.     Else
  56.         GetPiece = ""
  57.     End If
  58. End Function
  59.  
  60.  
  61.