Xceed Zip Compression Library Documentation
VB type conversion from Long to Double
Example topics > VB type conversion from Long to Double

In VB, "unsigned" integer types do not exist. Variables declared as Long are signed, which means that instead of having a range of 0 to 4294967296, they have a range of –2147483648 to +2147483647. When an Xceed Zip v5.0 event returns a value larger than 2147483647 the number is too big to fit in a Long variable.

When using events such as GlobalStatus or FileStatus, parameters such as lBytesProcessed may surpass 2147483647 when dealing with large groups of files or files larger than 2GB.

If you want to display a positive value above VB's Long integer's maximum range, you can use a Double and do the following conversion (example shown for lBytesProcessed parameter):

Visual Basic Copy Code

Dim dBytesProcessed as Double 

dBytesProcessed = lBytesProcessed 

If lBytesProcessed < 0 Then dBytesProcessed = dBytesProcessed + 4294967296 Then
  ' Now, dBytesProcessed contains a value between 0 and 4294967295
End If

Keep in mind that as of version 5.0 of Xceed Zip Compression Library, all events that report byte/size information have a 64-bit counterpart that can be used when dealing with files larger than 2 gigs.