Robert,
[quoted text, click to view] > Do you advocate using ANY of the functionality in the
> Microsoft.VisualBasic namespace?!? Ever?
I totally advocate using the functions in the Microsoft.VisualBasic
namespace, especially when using them would "prevent me from reinventing the
wheel".
This does not mean that I use Microsoft.VisualBasic over the other Framework
classes. I use which ever class/method makes the most sense for what I need
done!
For example the Microsoft.VisualBasic.Strings.Split function allows one to
split a string based on words, instead of a single chars that String.Split
does or a pattern that RegEx.Split does. However if I was splitting a string
based on a Char I would use String.Split, likewise if I was splitting a
string based on a Pattern I would use RegEx.Split. 3 functions servicing 3
specific needs.
Same with Microsoft.VisualBasic.Strings.Replace. It has options that
String.Replace, StringBuilder.Replace, and RegEx.Replace do not have.
Remember that a number of the functions in the Microsoft.VisualBasic
namespace are easily used in other languages, such as C#. So if I needed to
split a String based on a word in C#, I would use
Microsoft.VisualBasic.Strings.Split!
Err.Raise(0) sounds like a clever "hack", If there was not a cleaner way to
transfer control I have used custom Exceptions to "get out" of a deeply
nested routine, especially when using functions with a status makes the code
harder to follow rather then easier to follow, and the Exception out is not
the normal flow of control for the routine... However as Herfried suggests
using an Exception to jump out of nested routines, should only be used
exceptional cases...
Hope this helps
Jay
[quoted text, click to view] "Robert" <no@spam.com> wrote in message
news:OuaPShY9EHA.2032@tk2msftngp13.phx.gbl...
> inline..
>
> "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
> news:OknwmbX9EHA.2192@TK2MSFTNGP14.phx.gbl...
>> "Robert" <no@spam.com> schrieb:
>>>I am familiar with exceptions, however throwing an error of 0 is
>>>basically saying there is no error.
>>>
>>> In the code it appears it is being used to do a far return to the
>>> routine closest on the call stack, with an error handler.
>>
>> Exceptions should not be used to control program flow.
>
>
> Agreed. Not my code.. Did not want to break interfaces.
>
>
>>> Also, is there a FAQ on how to work around all the functions in
>>> Microsoft.VisualBasic?
>>
>> There is no need to work around the functions included in
>> "Microsoft.VisualBasic.dll" because they are part of VB.
>
> If it is part of VB, why must one Import the namespace (either in each of
> your code files) or at the project properties/imports level?
> Seems to be an add-on library, and not part of the the VB to IL compiler
> process..
> Since I can NOT use these functions for a PocketPC port I would love to
> find a resource with the common work arounds.
>
> Do you advocate using ANY of the functionality in the
> Microsoft.VisualBasic namespace?!? Ever?
> I do not use this namespace. I have read numerous articles about the
> performance hits, and after all it is just a wrapper around the System
> namespaces.
>
> Hope I do not come across as an ass, but it seems you completely missed my
> points.
>
> Anyway, if you know of a FAQ the touches on removing this depencency,
> please post it. It would prevent me from reinventing the wheel.
>
>
> Thanks again.
>