Re: Need some help...
- From: "Tom Leylan" <tleylan@xxxxxxxxxx>
- Date: Sun, 17 Dec 2006 19:51:09 -0500
Possibly a good time to introduce the debugger... if you are going to
monitor code take the opportunity to see how breakpoints, watchpoints, step
and trace work.
"Stephany Young" <noone@localhost> wrote in message
news:O5OSlwjIHHA.448@xxxxxxxxxxxxxxxxxxxxxxx
Yes ... But I would term it 'BEFORE the start of the loop' rather than
'OUTSIDE the start of the loop' which could also include after the end of
loop (for those that are picky).
And yes, the actual call to i_Compress.CompressFolder MUST be inside the
loop.
I don't understand why the call to i_Compress.CompressFolder is not
working. It takes 4 parameters and they are:
_Folder,
Path.ChangeExtension(Path.Combine(strTargetDir, _deepestnode), "cab")
""
0
The 1st parameter is the source folder.
The 2nd parameter is the name of the resultant .cab file.
The 3rd parameter is a filter for dealing only with a subset of files. ""
(empty string) means don't filter.
The 4th parameter is for limiting the size of any one .cab file. 0 (zero)
means don't limit.
Directly before that line you can throw in:
Console.WriteLine(_Folder)
Console.WriteLine(Path.ChangeExtension(Path.Combine(strTargetDir,
_deepestnode), "cab"))
and then you can make sure that the values are as expected. (Make sure you
run it from the IDE and the results will be displayed in the Output
window).
"Bruce W. Darby" <kracor@xxxxxxxxxxx> wrote in message
news:55udnSZaNIWORBjYnZ2dnUVZ_q6vnZ2d@xxxxxxxxxxxxxx
Christmas shopping almost finished.... :)
"Stephany Young" <noone@localhost> wrote in message
news:ufmpHpiIHHA.960@xxxxxxxxxxxxxxxxxxxxxxx
So you've found that there's nothing more sobering than looking at code
you have written yourself and saying, 'What idiot wrote this rubish?'.
:)
And nothing more sobering than doing it 5 minutes after you post a
EUREKA! on the newsgroup. :)
You are making 2 calls to the Path.GetFileName() method with the same
parameter, to get the name of the deepest node of the folder path. I my
view it is better to call that method once, store the result in a local
variable and use that when you need to:
A logical conclusion and one which I shall take to heart.
You then don't need the local variable strFinalFile and the line where
that is used becomes:
i_Compress.CompressFolder(_Folder,
Path.ChangeExtension(Path.Combine(strTargetDir, _deepestnode), "cab"),
"", 0)
This won't work. I've already tried it. Not sure why but it gives me an
IO error stating that I'm passing too many variables.
The instantiation of i_Compress is still inside the loop. This will
cause unecessary overhead and should be moved to a point before the
start of the loop. Think of it like making a cup of coffee and leaving
it on the beench of your kitchen. Every time you want a sip you have to
go out to the kitchen and then return to your office. I'm sure that you
would consider that to be a waste of your resources (time and effort).
Now, to make sure I've got this down... The line stating Dim i_Compress
as New CabLib.Compress should occur on any line OUTSIDE the start of the
For...Next loop, but the actual line stating i_Compress.CompressFolder...
should be on a line INSIDE the loop?
Onward and upward :)
As Mork would have stated.... Nanoo...Nanoo... :) Sorry, can't do the
spreadfingered handshake here... might get me arrested. :)
.
- Follow-Ups:
- Re: Need some help...
- From: Bruce W. Darby
- Re: Need some help...
- References:
- Need some help...
- From: Bruce W. Darby
- Re: Need some help...
- From: Stephany Young
- Re: Need some help...
- From: Bruce W. Darby
- Re: Need some help...
- From: Stephany Young
- WAS: Need some help...
- From: Bruce W. Darby
- Re: Need some help...
- From: Stephany Young
- Re: Need some help...
- From: Bruce W. Darby
- Re: Need some help...
- From: Stephany Young
- Re: Need some help...
- From: Bruce W. Darby
- Re: Need some help...
- From: Stephany Young
- Need some help...
- Prev by Date: Re: Need some help...
- Next by Date: Re: ActiveX raise event - attn Walter Wang
- Previous by thread: Re: Need some help...
- Next by thread: Re: Need some help...
- Index(es):
Relevant Pages
|
Loading