Back to product page
Progress64 event
Fires during crypto operation.
Syntax
- Basic
Private Sub object_Progress64(PositionHi, Position, TotalHi, Total)
The Progress64(object,PositionHi,Position,TotalHi,Total) syntax has these parts:
The Progress64(object,PositionHi,Position,TotalHi,Total) syntax has these parts:
object | A wodCrypt object. |
PositionHi | A Long value. Higher long value of 64bit integer for current position in the blob. |
Position | A Long value. Lower long value of 64bit integer for current position in the blob. |
TotalHi | A Long value. Higher long value of 64bit integer for total number of bytes in the blob. |
Total | A Long value. Lower long value of 64bit integer for total number of bytes in the blob. |
Remarks
The Progress event may fire many times during the execution of some crypto methods, while wodCrypt operates on the data. This event is fired only if the FireEvents property is set to True.If position or total arguments fits into 32bit long integer, Progress event is fired instead of this one. Depending on the programming language you use, you will need to convert these values to appropriate int64 integer.
Code sample
- Basic
NOTE: it is possible that Position or Total values become negative - it is because unsigned values are used, but VB (and other environments) expect to see signed values. If this happens, we suggest you use following code (VB example):
Private Const MAX_UNSIGNED = 4294967296# ' HEX 1,0000,0000
Private Sub Crypto_Progress(ByVal Position As Long, ByVal Total As Long)
Crypto_Progress64 Position, 0, Total, 0
End Sub
Private Sub Crypto_Progress64(ByVal PositionHi As Long, ByVal Position As Long, ByVal TotalHi As Long, ByVal Total As Long)
If Total <> 0 And TotalHi <> 0 Then
Dim pos As Double
Dim tot As Double
pos = Position
If (pos < 0) Then pos = pos + MAX_UNSIGNED
tot = Total
If tot < 0 Then tot = tot + MAX_UNSIGNED
If TotalHi <> 0 Then
pos = pos + PositionHi * MAX_UNSIGNED
tot = tot + TotalHi * MAX_UNSIGNED
End If
Debug.Print "Progress " & pos & "/" & tot
Else
Debug.Print "Progress " & Position & "/" & Total
End If
End Sub
Private Const MAX_UNSIGNED = 4294967296# ' HEX 1,0000,0000
Private Sub Crypto_Progress(ByVal Position As Long, ByVal Total As Long)
Crypto_Progress64 Position, 0, Total, 0
End Sub
Private Sub Crypto_Progress64(ByVal PositionHi As Long, ByVal Position As Long, ByVal TotalHi As Long, ByVal Total As Long)
If Total <> 0 And TotalHi <> 0 Then
Dim pos As Double
Dim tot As Double
pos = Position
If (pos < 0) Then pos = pos + MAX_UNSIGNED
tot = Total
If tot < 0 Then tot = tot + MAX_UNSIGNED
If TotalHi <> 0 Then
pos = pos + PositionHi * MAX_UNSIGNED
tot = tot + TotalHi * MAX_UNSIGNED
End If
Debug.Print "Progress " & pos & "/" & tot
Else
Debug.Print "Progress " & Position & "/" & Total
End If
End Sub