Groups | Blog | Home
all groups > vb.net > june 2004 >

vb.net : stop creation


Frank
6/14/2004 7:41:00 PM
Hello,
I have as class and when I get wrong data when creating the object (in the
'new' routine) I want to break off the creation of the classObject, so it
results in 'nothing' to the creator . How can I do that?
Thanx
Frank

Armin Zingler
6/14/2004 8:01:47 PM
"Frank" <frank@frank.com> schrieb
[quoted text, click to view]

Catch the error in the procedure creating the object.
Optionally/Additionally add a shared function to the class creating the
object and returning Nothing if an exception was thrown.


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
hirf-spam-me-here NO[at]SPAM gmx.at
6/14/2004 8:30:32 PM
* "Frank" <frank@frank.com> scripsit:
[quoted text, click to view]

Throw an exception in the ctor. Alternatively, you can provide a shared
method that returns an object of the class' type or 'Nothing' if
creation fails.

--
Herfried K. Wagner [MVP]
Armin Zingler
6/15/2004 2:18:48 PM
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> schrieb
[quoted text, click to view]

Good suggestion! ;-)


--
Armin
AddThis Social Bookmark Button