> dim bExists as boolean, s as string
> on error resume next
[quoted text clipped - 9 lines]
> HTH,
> TC
That's very good, and certainly a lot quicker than enumerating a Collection.
I hesitated to go there as I was concerned about the OP's level of
experience. However, on further reflection, this an excellent suggestion no
matter what level, because every VB programmer needs to learn how to use
Error Handling in a "positive" way.
I would add only one suggestion. Instead of simply turning off the Error
Handler (On Error Goto 0), it would likely be more useful to reset it to
something else to inorder to guard the remaining code.
-ralph
smk23 - 31 Dec 2005 22:34 GMT
thanks! really useful.

Signature
sam
> > dim bExists as boolean, s as string
> > on error resume next
[quoted text clipped - 22 lines]
>
> -ralph
TC - 31 Dec 2005 22:59 GMT
I look at it this way. If the person understands error handling, they
will automatically adjust it to suit their own requirements. But if
they /don't/ understand it - the safest assumption, imho - they will
get the safest style, which is, to die on the spot, thereby showing
exactly where the error occured.
Cheers,
TC
Ralph - 31 Dec 2005 23:47 GMT
> I look at it this way. If the person understands error handling, they
> will automatically adjust it to suit their own requirements. But if
[quoted text clipped - 4 lines]
> Cheers,
> TC
LOL.
The whole subject of "Error Handling" and programmers has always fascinated
me. (And as I have already started on several cups of Holiday Cheer I am
beginning to lean philosophically. Which always proceeds the physical lean.
<g>)
As you pointed out - 'to die on the spot' - should be a great learning tool,
but so seldom is. All concentration is on the error and how to 'fix it',
little is saved for appreciating a means to guard for it and provide
alternatives. While all history is against the view - it continues that
programmers envision they can write absolutely error-free code.
We can insure code is always logically correct, but never error-free. Error
Handling can authenticate the former and protect us from the assumptions of
the latter.
Happy New Year.
-ralph