UnRAR Wrapper for ThinBasic Programming Language.
- Windows 7 above (recommend)
- ThinBasic 1.13 above (recommend)
- UnRAR
Building requires ThinBasic Interpreter and test under Windows 10.
Type features require ThinBasic 1.4.0 and above.
Extract the RAR file
Uses "CONSOLE"
#INCLUDE Once ".\Core\Enums.inc"
#INCLUDE Once ".\Core\Runtime.inc"
#Include Once ".\Core\RARArchive.inc"
#Include Once ".\Core\UnRARWrapper.inc"
Dim UnRAR As UnRARArchive
Global lpszSampleFilePath As String
Global ArchiveData As RAROpenArchiveDataEx
Global HeaderData As RARHeaderDataEx
Global hRARArchiveHandle As Long
Global hUnRARProcCode As Long
lpszSampleFilePath = ".\TestFile\example.rar"
ArchiveData.ArcNameW = Ascii2Unicode(lpszSampleFilePath)
ArchiveData.OpenMode = $RAR_OM_EXTRACT
ArchiveData.CmtBuf = ""
ArchiveData.CmtBufSize = 0
hRARArchiveHandle = UnRAR.OpenArchiveEx(ArchiveData)
If ArchiveData.OpenResult = $ERAR_SUCCESS Then
Printl("Source: " & lpszSampleFilePath)
While UnRAR.ReadHeaderEx(hRARArchiveHandle, HeaderData) = $ERAR_SUCCESS
hUnRARProcCode = UnRAR.ProcessFileW(hRARArchiveHandle, $RAR_TEST, "", "")
Printl "Test File: " & HeaderData.FileNameW
Wend
End If
UnRAR.CloseArchive(hRARArchiveHandle)
Copyright (c) 2020-2024 Ji-Feng Tsai.
Code released under the MIT license.
- More examples
If this application help you reduce time to coding, you can give me a cup of coffee :)