Re: Need some help...
- From: "Bruce W. Darby" <kracor@xxxxxxxxxxx>
- Date: Sun, 17 Dec 2006 16:56:06 -0700
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: Stephany Young
- 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
- Need some help...
- Prev by Date: Re: video
- Next by Date: Re: Need some help...
- Previous by thread: Re: Need some help...
- Next by thread: Re: Need some help...
- Index(es):
Relevant Pages
|