
LstMismatchedFiles.AddItem m_ZipFileName 'add it to the Mismatched Files list & quit searching If I = -1& Then 'If zip file has a file not found in the DatFile, M_FileNamesUB = m_FileNamesUB - 1& 'Decrement m_FileNamesUB to simulate shrinking the array (this is faster than ReDim Preserve)Įxit For 'Stop scanning once a match is found and the relevant array elements are rearranged PutMem4 VarPtr(m_FileNames(I)), K 'If the matching filename is at the end of the array however,Įnd If 'simply exclude it from the active elements of the array PutMem4 VarPtr(m_FileNames(m_FileNamesUB)), J K = StrPtr(m_FileNames(m_FileNamesUB)) 'Note: swapping string pointers is faster than exchanging string data J = StrPtr(m_FileNames(I)) 'Swap it with the last element If I < m_FileNamesUB Then 'If the matching filename isn't at the end of the array If m_FileNames(I) = sFileName Then 'and look for the filename If I Then sFileName = Mid$(sFileName, I + 1&) 'If it does, strip the path from the filenameįor I = m_FileNamesUB To 0& Step -1& 'Scan the m_FileNames array backwards I = InStrRev(sFileName, "/") 'See if the filename contains a path SysReAllocStringLen VarPtr(sFileName),, CDFH.FileNameLen If (CDFH.GPFlag And EFS) = 0 Then 'If filename (and comment) are in the original ZIP character encoding (IBM Code ) If (CDFH.ExtFileAttribs And vbDirectory) vbDirectory Then 'If not a folder Pos = EOCD.CDStartOffset + 1& 'Must add 1 because the Get statement is 1-basedĭo While EOCD.DiskCDRecords 'Examine all central directory records on this disk If EOCD.Signature = EOCD_SIGNATURE Then Exit For Pos = LOF(FN) + 1& 'Must add 1 because the Get statement is 1-basedįor Pos = Pos - 22& To Pos - &H10015 Step -1& 'Scan the file backwards starting from (LOF - EOCD min size) to (LOF - EOCD max size) Open sFileName For Binary Access Read Lock Write As FN If (GetAttr(sFileName) And vbDirectory) vbDirectory Then 'Must verify the zip file already exists because Open For Binary will create it if missing SFileName = Left$(sFileName, InStrRev(sFileName, "\")) & m_ZipFileName 'Build a fully-qualified filename from the specified DatFile and ZIP filename Private Sub IVBSAXContentHandler_endElement(strNamespaceURI As String, strLocalName As String, strQName As String)Ĭonst CDFH_SIGNATURE = &H2014B50, EOCD_SIGNATURE = &H6054B50, EFS = &H800 'EFS - Language encoding flagĭim FN As Integer, I As Long, J As Long, K As Long, Pos As Longĭim sFileName As String, CDFH As CDFH, EOCD As EOCD RichTextBox2.Text = RichTextBox2.Text & GetBetween(mMyArray(ii), Text9.Text, Text10.Text) & vbNewLine


Xa = GetBetween(MyArray(i), Text2.Text, Text3.Text) MyArray() = Split(TextFileData, Text1.Text) Open App.Path & "\FB Alpha v0.2.97.30.dat" For Binary As #1

Dim TextFileData As String, MyArray() As String, i As Longĭim output() As String, outputt() As String
