VBScript
VBScript
Transition from Zip.FirstMatchingEntry to Zip.EntryMatching
Provides instructions for replacing deprecated FirstMatchingEntry method calls with EntryMatching.Chilkat VBScript Downloads
Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
'Create a Unicode (utf-16) output text file.
Set outFile = fso.CreateTextFile("output.txt", True, True)
success = 0
set zip = CreateObject("Chilkat.Zip")
' ...
' ...
pattern = "*.txt"
' ------------------------------------------------------------------------
' The FirstMatchingEntry method is deprecated:
' entryObj is a Chilkat.ZipEntry
Set entryObj = zip.FirstMatchingEntry(pattern)
If (zip.LastMethodSuccess = 0) Then
outFile.WriteLine(zip.LastErrorText)
WScript.Quit
End If
' ...
' ...
' ------------------------------------------------------------------------
' Do the equivalent using EntryMatching.
' Your application creates a new, empty ZipEntry object which is passed
' in the last argument and filled upon success.
set ze = CreateObject("Chilkat.ZipEntry")
success = zip.EntryMatching(pattern,ze)
If (success = 0) Then
outFile.WriteLine(zip.LastErrorText)
WScript.Quit
End If
outFile.Close