Archives (RT) - Read batch information
With zenOn 6.22 SP0 a new method has been implemented for read out batch infomration which are stored in the batch index file (.ari).
The method Archive.BatchIndex returns for each batch following information in a String-Array:
ARX-FileName;Batchname;Starttime in seconds;Endtime in seconds
Below you can find an example how to use this method
VBA Code:
Option Explicit
Sub GetBatches_Click()
Dim obArchives As Archives
Dim obArchive As Archive
Dim iArchives As Integer
Dim strArray
Dim iArray As Integer
Dim strArrayBatch
Dim iArrayBatch As Integer
Set obArchives = thisProject.Archives
If obArchives.count = 0 Then
MsgBox "No archives configured!"
Exit Sub
End If
Debug.Print ("Count Archives: " & obArchives.count)
For iArchives = 0 To obArchives.count - 1
'get the single archive
Set obArchive = obArchives.Item(iArchives)
If obArchive Is Nothing Then
MsgBox "Error getting archive " & obArchives.Item(iArchives)
Exit Sub
End If
Debug.Print ("Archive: " & obArchive.Name)
'get the complete batchindex
strArray = obArchive.BatchIndex
Debug.Print ("Count Batches: " & UBound(strArray))
'split up the string array (list of batches)
For iArray = 0 To UBound(strArray)
'get the single batches and split it up
strArrayBatch = Split(strArray(iArray), ";")
'write the each single batch string to the listbox (in seperate columns)
For iArrayBatch = 0 To UBound(strArrayBatch)
'structure of array:
'0=ARX-FileName; 1=Batchname; 2=Starttime in seconds; 3=Endtime in seconds
Debug.Print "-> " & strArrayBatch(iArrayBatch)
Next iArrayBatch
Next iArray
Debug.Print ""
Next iArchives
End Sub
In the attachment you can find a VBA Form which reads out the batch information into a Listbox (seperate columns).
Regards,
Herbert
This is a migrated post! Originally posted on 20.04.2009 by user herberto. Please be aware that information can be outdated.