Posted: Sat Mar 25, 2006 12:10 pm
Yes, gnozal is a bit busy right now ... Perhaps for the next version.PAMKKKKK wrote:I dont remark that gnozal hasn´t made any choice to change compression mode......
http://www.purebasic.com
https://www.purebasic.fr/english/
Yes, gnozal is a bit busy right now ... Perhaps for the next version.PAMKKKKK wrote:I dont remark that gnozal hasn´t made any choice to change compression mode......
Ok, in my purebasic folder I have the following..gnozal wrote:DLL in the same directory than the EXEwebbmeister wrote:Look folks, you will have to bear with me on this. Im not a beginner as far as general programming technique is concerned, but in terms of using libs & dlls etc and where to put them, I am a big clueless.
What I want to do is ZIP c:\test.txt to c:\test.zip. I am using version 4 beta 7. A simple working example would be great + which lib files / dlls do I need to place where.
I know it's a lot to ask
Libraries in %Purebasic%\PureLibraries\UserLibraries
Code: Select all
myzip.s = "c:\purebasic393\program\PureZIP-test.zip"
myzipfile1.s = "C:\PureBasic393\Program\PureCOLOR_TEST_2.pb"
myzipfile2.s = "C:\PureBasic393\Program\PureCOLOR_TEST_3.pb"
OpenConsole()
If PureZIP_Archive_Create(myzip.s, #APPEND_STATUS_CREATE)
PureZIP_Archive_Compress(myzipfile1.s, #False)
PureZIP_Archive_Compress(myzipfile2.s, #False)
PureZIP_Archive_Close()
EndIf
CloseConsole()
I think I get it now. It's hard to grasp at first how all the versions and dlls gel together. Are there any examples out there for ASCIItoLATIN on num 3?gnozal wrote:You can't mix code and expect it to work.
Either use PureZIP with PB3.94 (will be updated for PB4.00 final) or Num3's code with DLL with PB4.00 beta.
And please note this is a PureZIP thread : post coding questions in the appropriate forum 'Coding Questions' http://www.purebasic.fr/english/viewforum.php?f=13
Thanks.
Here's the code :webbmeister wrote:I think I get it now. It's hard to grasp at first how all the versions and dlls gel together. Are there any examples out there for ASCIItoLATIN on num 3?
Code: Select all
INLINE ASM !
; Conversion AsciiDosLatinUS vers AsciiWinLatin1 (caractères accentuées)
; par Denis (Forum Français)
Procedure AsciiDosLatinUS_To_AsciiWinLatin1(StringPointer.l) ; Transforms a string from ASCII DOS Latin US to ASCII WIN Latin 1
; Ex: AsciiDosLatinUS_To_AsciiWinLatin1(@MaChaine.s)
;
! LEA Ebx, [TableConversion]
MOV Ecx, StringPointer
! Boucle :
! MOV al, byte [Ecx]
! TEST al, al
! JZ FinChaine
! CMP al, $80
! JNA CarSuivant
! ADD al, -$80
! XLATB
! MOV byte[Ecx], al
! CarSuivant:
! INC Ecx
! JMP Boucle
;
; table des 128 caractères de remplacement
;
! TableConversion:
! DB $C7, $FC, $E9, $E2, $E4, $E0, $E5, $E7, $EA, $EB, $E8, $EF, $EE, $EC, $C4, $C5
! DB $C9, $E6, $C6, $F4, $F6, $F2, $FB, $F9, $FF, $D6, $DC, $A2, $A3, $A5, $20 ,$83
! DB $E1, $ED, $F3, $FA, $F1, $D1, $AA, $BA, $BF, $20, $AC, $BD, $BC, $A1, $AB, $BB
! DB $20, $20, $20, $20, $20, $20, $20, $20, $20, $20, $20, $20, $20, $20, $20, $20
! DB $20, $20, $20, $20, $20, $20, $20, $20, $20, $20, $20, $20, $20, $20, $20, $20
! DB $20, $20, $20, $20, $20, $20, $20, $20, $20, $20, $20, $20, $20, $20, $20, $20
! DB $20, $DF, $20, $20, $20, $20, $B5, $20, $20, $20, $20, $20, $20, $20, $20, $20
! DB $20, $B1, $20, $20, $20, $20, $F7, $20, $B0, $20, $B7, $20, $20, $B2, $20, $20
! FinChaine:
EndProcedure
Code: Select all
Procedure ZIP_TEST(); Small procedure to test the procedures
If ZIP_Lib_Init()
;**** Create Zip File **********
;MessageRequester("Message","Select a new zip filename to create")
Goto jumper
file.s="c:\test.zip"
; MessageRequester("message",file.s)
If file
add_file.s="c:\test.txt"
If add_file
; MessageRequester("message",add_file)
Handle.l=ZIP_FileCreate(file,#APPEND_STATUS_CREATE)
If Handle
; MessageRequester("Message","Select a file to insert into the zip")
If ZIP_FileAdd(Handle,add_file,GetFilePart(add_file))
Debug "File Added to Archive..."
EndIf
ZIP_FileClose(Handle)
EndIf
EndIf
EndIf
End
jumper:
zip_lib_init()
file.s=OpenFileRequester("Select a Zip","*.zip","Zip|*.zip",0)
If file
myFileinfo.unz_file_info
Count.l=ZIP_FileCount(file)
Debug "This zip has " + Str(Count) + " itens"
; out_path.s=PathRequester("Extracto to:" ,"d:\temp")
For a=0 To Count-1
ZIP_GetFileInfo(file,a,@myFileinfo)
Filesize.l=myFileinfo\uncompressed_size
If Filesize>0
Debug "Filename: " + myFileinfo\FileName
Debug "Compressed Size: " + Str(myFileinfo\compressed_size)
Debug "Uncompressed Size: "+ Str(Filesize)
; If ZIP_ExtractFile(file,a,out_path,#False)
;Debug "File Extracted"
; EndIf
Debug "***************"
Else
Debug "Directory: " + myFileinfo\FileName
Debug "***************"
EndIf
Next
EndIf
ZIP_Lib_Stop()
Goto jumper
EndIf
End
EndProcedure