<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1170" name=GENERATOR></HEAD>
<BODY style="MARGIN-TOP: 2px; FONT: 8pt Tahoma; MARGIN-LEFT: 2px">
<DIV><SPAN class=956294519-15072003><FONT size=2>Thanks, I'll read
it.</FONT></SPAN></DIV>
<DIV> </DIV>
<P><FONT size=2>John W. Colby<BR>www.colbyconsulting.com</FONT> </P>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT size=2>-----Original
Message-----<BR><B>From:</B> dba-vb-bounces@databaseadvisors.com
[mailto:dba-vb-bounces@databaseadvisors.com]<B>On Behalf Of </B>Gary
Ray<BR><B>Sent:</B> Tuesday, July 15, 2003 3:10 PM<BR><B>To:</B>
dba-vb@databaseadvisors.com<BR><B>Subject:</B> Re: [dba-VB] OT: VB.Net -
general questions<BR><BR></FONT></DIV>
<DIV><FONT size=2>John,</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Take a look at this article:</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><A
href="http://www.vbdotnetheaven.com/Code/Apr2003/009.asp">http://www.vbdotnetheaven.com/Code/Apr2003/009.asp</A></DIV>
<DIV> </DIV>
<DIV><FONT size=2>Basically, the System object exposes an Exception object
that many of the other framework classes extend. I am not sure if there
is a named object for a "missing collection exception", but if you look at the
article it explains how to hande the select case type of exception traps that
you are talking about.</FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Gary Ray - Application Developer<BR>Workforce Information Systems R &
D<BR>E-Mail <A
href="mailto:gray@utah.gov">gray@utah.gov</A><BR><BR>>>>
jcolby@colbyconsulting.com 07/14/03 12:16PM >>><BR>I am porting my
SysVars class to VB.Net just as an exercise. Of course I<BR>use the
error handler insertion wizard for Access, but VB.Net has the new<BR>Try/catch
error handling (which I very much like BTW). But it does mean<BR>that no
port is trivial since I have to remove all the OnError / resume kind<BR>of
stuff in every function.<BR><BR>In my old code I have a case statement where I
accumulated the various<BR>errors that could occur, and once handled a resume
next would take me back<BR>into the code. that obviously has to change
but I'm a little confused as to<BR>what it will change to. For example I
have code that attempts to add an<BR>object to a
collection:<BR><BR> mcolObjNames.Add(strObjName,
strObjName)<BR><BR>There could be two problems here, the first is that no
collection has been<BR>instantiated yet, the second is that the object is
already in the<BR>collection. Thus a select case would be nice, which
was how the old error<BR>handler in Access worked.<BR><BR>Select case
err<BR> case XXX<BR> case
YYY<BR> Case else<BR>end select<BR><BR>Now we
have:<BR><BR>Try<BR><BR> mcolObjNames.Add(strObjName,
strObjName)<BR><BR>Catch e as XXXX (FIRST PROBLEM - WHAT IS
xxxx?)<BR> Handle error here<BR>Finally<BR><BR>End
Try<BR><BR>It certainly looks like e could be used in a select case
statement. However<BR>to do so I need the equivalent of the "resume
next".<BR><BR><BR>AND FINALLY...<BR><BR>In access I also used a label for the
exit such that all exiting code could<BR>go through the exit point for cleanup
of pointers etc. The books I have<BR>don't ever show such a
construct.<BR><BR><BR>John W. Colby<BR><A
href="http://www.colbyconsulting.com/">www.colbyconsulting.com</A><BR><BR><BR>_______________________________________________<BR>dba-VB
mailing list<BR>dba-VB@databaseadvisors.com<BR><A
href="http://databaseadvisors.com/mailman/listinfo/dba-vb">http://databaseadvisors.com/mailman/listinfo/dba-vb</A><BR><A
href="http://www.databaseadvisors.com/">http://www.databaseadvisors.com</A><BR><BR></DIV></BLOCKQUOTE></BODY></HTML>