Re: Need some help...



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



.



Relevant Pages

  • Re: Need some help...
    ... 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! ... error stating that I'm passing too many variables. ... For...Next loop, but the actual line stating i_Compress.CompressFolder... ...
    (microsoft.public.dotnet.languages.vb)
  • 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: Continous Looping of a List
    ... > that I need the loop to be continuous. ... May fault for not stating the problem more clearly. ... Assuming you do have some sort of valid ...
    (comp.lang.perl.misc)
  • Re: phase lock loop (PLL) HELP
    ... > i need help for design the phase lock loop. ... You're not the only one who "feels trouble" in loop filter ... CMOS Cookbook, and look at his treatment of the 4046. ...
    (sci.electronics.basics)