I have a simple mind, so I like simple procedure calls...
So I decided to write a few simple procedures that would suit my needs, but no matter what I try, I end up creating the packed file in my root directory. As you can see, I change the directory to the desired location, but it seems that CreatePack() overwrites my wishes!
Any ideas?
--blueb
Code: Select all
; ==================================================================================
; Create 3 simplified Pack Procedures for PureBasic
;
;PackDir("C:\BigJob") - creates a packed file called: BigJob.pak **in this directory **
;PackFile("Fred.doc") - creates a packed file called: fred.pak in same directory
;UnPack("BigJob.pak") - unzips all files in the same directory as file was located.
; ==================================================================================
Procedure.l PackDir(SourceDir$)
; -------------------------------------------------------------------------------------
;#1 PackDir
;PackDir("C:\BigJob") - creates a packed file called: BigJob.pak **in this directory **
; -------------------------------------------------------------------------------------
;Change to Source Directory
a$ = SourceDir$
If SetCurrentDirectory_(@a$) = 0
MessageRequester("Error","Can't find directory " + Chr(10) + Chr(13) + "Or doesn't exist! " + Chr(10) + Chr(13) + "Please re-type your choice",0)
End
EndIf
If GetCurrentDirectory_( a$, @a$)
MessageRequester("This is your Current Directory",a$,0)
EndIf
a$ = a$ + ".pak"
hPack.l = CreatePack(a$)
MessageRequester("Zero = NOT successful", Str(hPack), 0)
Result = ClosePack()
EndProcedure ; PackDir procedure
; ---------------------------------
; Main
PackDir("c:\BigJob")
