Here attached something to test
Install new moduleAttached thinBasic_zLib.dll module, new zLib module. I had undergo from zlib_1.2.5 to zLib_1.2.3 because password protected
Please Extract it under your \thinBasic\Lib\ directory substituting your current one.
How to useNew syntax of ZLib_ExtractToZip is:
StringBuffer = ZLib_ExtractToZip(sZipFile, FileNameToExtract [, sPassword])
If StringBuffer is not empty than you will have the uncompressed file and you can do whatever you want.
ExampleGet Media.zip file from lassad previous post.
Place it in the same directory of your script.
Than execute the following script.
If all will went fine, you will have 2 new file extracted on disk.
uses "ZLib"
Dim sBuffer As String
Dim ZIPFileName As String
ZIPFileName = APP_ScriptPath & "media.ZIP"
sBuffer = ZLib_ExtractToString(ZIPFileName, "bones.jpg", "passeport")
Save_File(APP_ScriptPath & "bones.jpg", sBuffer)
sBuffer = ZLib_ExtractToString(ZIPFileName, "bones_all.x", "passeport")
Save_File(APP_ScriptPath & "bones_all.x", sBuffer)
If all is working fine, I will see what other functions I can develop.
For sure something like ZLib_ExtractToHeap, exactly the same of ZLib_ExtractToString but will return an Heap memory pointer.
Let me know.
Eros
Bookmarks