Re: Need some help...



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. :)


.



Relevant Pages

  • RE: Decrementing row after deletion
    ... You might want to exit your second loop when you delete the row. ... "SueCool" wrote: ... I''''m not a complete idiot - there are some parts missing! ... If MyPos> 0 Then ...
    (microsoft.public.excel.programming)
  • Re: Need some help...
    ... The only one of these tools that I haven't used is the trace. ... loop. ... The 3rd parameter is a filter for dealing only with a subset of files. ... IO error stating that I'm passing too many variables. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Need some help...
    ... and trace work. ... loop. ... The 3rd parameter is a filter for dealing only with a subset of files. ... IO error stating that I'm passing too many variables. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: working with 8 and 16 bit regions of mem
    ... >> Am I wrong in assuming that this loop will never run? ... I am feeling like an idiot, ... >> If you initialize ...
    (comp.lang.c)
  • dependency hell
    ... I can't install or uninstall any major packages anymore, or I spend an hour going in a loop trying to figure out ... dependencies. ... i tend to ignore the following kinds of replies: top-bottom-middle posting, grammar, spelling, read the manual you idiot, search google you idiot... ...
    (alt.os.linux.suse)