I'm using VB in ASP.NET, i would like to abort a class.
Best would be during the new member.
The result should be: Nothing
Is this possible? 9 1118
What do you mean with 'aborting' a class?
If you mean setting an instance of a class to Nothing in the constructor of
that class... AFAIK that can't be done.
"Edwin Knoppert" <in**@pbsoft.speedlinq.nl> wrote in message
news:dm**********@azure.qinip.net... I'm using VB in ASP.NET, i would like to abort a class. Best would be during the new member. The result should be: Nothing
Is this possible?
No. I'm almost positive new is always guaranteed to return an instance, or
throw an exception, no alternatives.
Karl
--
MY ASP.Net tutorials http://www.openmymind.net/
"Edwin Knoppert" <in**@pbsoft.speedlinq.nl> wrote in message
news:dm**********@azure.qinip.net... I'm using VB in ASP.NET, i would like to abort a class. Best would be during the new member. The result should be: Nothing
Is this possible?
Oh, and by the way, it's a good thing that it can't be done, else you'd have
to check for null each time you used new...ugh..ugly code.
The solution, by the way, is to your a Factory. make the constructor
private, and then create a static (shared in vb.net) method:
public class product
private sub new
end sub
public shared function CreateInstance() as Product
if (whatever) then
return nothing
end if
return new Product()
end function
end class
--
MY ASP.Net tutorials http://www.openmymind.net/
"Edwin Knoppert" <in**@pbsoft.speedlinq.nl> wrote in message
news:dm**********@azure.qinip.net... I'm using VB in ASP.NET, i would like to abort a class. Best would be during the new member. The result should be: Nothing
Is this possible?
Maybe you are right.
Similar:
A com interface should be possible to be recreated if it could be created
the first time.
(A short of guarantee/guideline which should be followed)
I guess it's no different for these kind of objects qua strategy.
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
schreef in bericht news:uu**************@TK2MSFTNGP12.phx.gbl... Oh, and by the way, it's a good thing that it can't be done, else you'd have to check for null each time you used new...ugh..ugly code.
The solution, by the way, is to your a Factory. make the constructor private, and then create a static (shared in vb.net) method:
public class product private sub new end sub
public shared function CreateInstance() as Product if (whatever) then return nothing end if return new Product() end function end class -- MY ASP.Net tutorials http://www.openmymind.net/
"Edwin Knoppert" <in**@pbsoft.speedlinq.nl> wrote in message news:dm**********@azure.qinip.net... I'm using VB in ASP.NET, i would like to abort a class. Best would be during the new member. The result should be: Nothing
Is this possible?
Which trimester?
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
If you push something hard enough,
it will fall over.
- Fudd's First Law of Opposition
"Edwin Knoppert" <in**@pbsoft.speedlinq.nl> wrote in message
news:dm**********@azure.qinip.net... I'm using VB in ASP.NET, i would like to abort a class. Best would be during the new member. The result should be: Nothing
Is this possible?
Huh?
Elaborate..
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> schreef in bericht
news:Ol**************@TK2MSFTNGP14.phx.gbl... Which trimester?
-- HTH,
Kevin Spencer Microsoft MVP .Net Developer If you push something hard enough, it will fall over. - Fudd's First Law of Opposition
"Edwin Knoppert" <in**@pbsoft.speedlinq.nl> wrote in message news:dm**********@azure.qinip.net... I'm using VB in ASP.NET, i would like to abort a class. Best would be during the new member. The result should be: Nothing
Is this possible?
Hmm, problems with my sentences?
:)
I'm from Holland.
"Edwin Knoppert" <in**@pbsoft.speedlinq.nl> schreef in bericht
news:dm**********@azure.qinip.net... Huh? Elaborate..
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> schreef in bericht news:Ol**************@TK2MSFTNGP14.phx.gbl... Which trimester?
-- HTH,
Kevin Spencer Microsoft MVP .Net Developer If you push something hard enough, it will fall over. - Fudd's First Law of Opposition
"Edwin Knoppert" <in**@pbsoft.speedlinq.nl> wrote in message news:dm**********@azure.qinip.net... I'm using VB in ASP.NET, i would like to abort a class. Best would be during the new member. The result should be: Nothing
Is this possible?
Sorry, Edwin. It was an abortion joke. Tasteless, and probably meaningless
in Holland. Pay no attention to the man behind the curtain.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
If you push something hard enough,
it will fall over.
- Fudd's First Law of Opposition
"Edwin Knoppert" <in**@pbsoft.speedlinq.nl> wrote in message
news:dm**********@azure.qinip.net... Hmm, problems with my sentences? :)
I'm from Holland.
"Edwin Knoppert" <in**@pbsoft.speedlinq.nl> schreef in bericht news:dm**********@azure.qinip.net... Huh? Elaborate..
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> schreef in bericht news:Ol**************@TK2MSFTNGP14.phx.gbl... Which trimester?
-- HTH,
Kevin Spencer Microsoft MVP .Net Developer If you push something hard enough, it will fall over. - Fudd's First Law of Opposition
"Edwin Knoppert" <in**@pbsoft.speedlinq.nl> wrote in message news:dm**********@azure.qinip.net... I'm using VB in ASP.NET, i would like to abort a class. Best would be during the new member. The result should be: Nothing
Is this possible?
I didn' tget it ,and it _was_ bad when you cleared it up...
:)
Karl
--
MY ASP.Net tutorials http://www.openmymind.net/
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:OI**************@TK2MSFTNGP12.phx.gbl... Sorry, Edwin. It was an abortion joke. Tasteless, and probably meaningless in Holland. Pay no attention to the man behind the curtain.
-- HTH,
Kevin Spencer Microsoft MVP .Net Developer If you push something hard enough, it will fall over. - Fudd's First Law of Opposition
"Edwin Knoppert" <in**@pbsoft.speedlinq.nl> wrote in message news:dm**********@azure.qinip.net... Hmm, problems with my sentences? :)
I'm from Holland.
"Edwin Knoppert" <in**@pbsoft.speedlinq.nl> schreef in bericht news:dm**********@azure.qinip.net... Huh? Elaborate..
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> schreef in bericht news:Ol**************@TK2MSFTNGP14.phx.gbl... Which trimester?
-- HTH,
Kevin Spencer Microsoft MVP .Net Developer If you push something hard enough, it will fall over. - Fudd's First Law of Opposition
"Edwin Knoppert" <in**@pbsoft.speedlinq.nl> wrote in message news:dm**********@azure.qinip.net... > I'm using VB in ASP.NET, i would like to abort a class. > Best would be during the new member. > The result should be: Nothing > > Is this possible? > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Daisy |
last post by:
From this page:
http://www.c-sharpcorner.com/2/mt_beginner1.asp
Thread class's Abort method is called to kill a thread permanently. Make
sure you call IsAlive before Abort.
if (...
|
by: LP |
last post by:
Hi,
I am starting a new thread from the main UI thread. If users clicks cancel
button, the thread is aborted:
workerThread.Abort();
ThreadAbort Exception is handeled in the worker thread:
...
|
by: Urs Vogel |
last post by:
Hi
I wrote an application server (a remoting sinlgeton), where processes must
be stopped in very rare cases, done thru a Thread.Abort(). Occasionally, and
only after a Thread.Abort(), this...
|
by: nidhig |
last post by:
Hi
I am trying to implement the Abort functionality in progress bar
control. Scenario is like this.
I have a web application which performs a very long computation
process. This computation...
|
by: Bob Altman |
last post by:
Hi all,
I have a WinForms app that has no main window (just a module with a Sub
Main). My Main routine calls a subroutine that wants to politely abort the
application rather than return to its...
|
by: Alan T |
last post by:
I will do several things in my thread:
Copy a file to a location
Update database record
Read the file content
Write the content to a log file
If I call Thread.Abort(), it may be possible to...
|
by: Marvin Barley |
last post by:
I have a class that throws exceptions in new initializer, and a static
array of objects of this type.
When something is wrong in initialization, CGI program crashes
miserably. Debugging shows...
|
by: andrew |
last post by:
Hi,
I have the following issue with the Thread.Abort():
The main thread creates a worker thread which waits on a process
termination.
void ThreadProc()
{
Process proc =...
|
by: Nimral |
last post by:
Hi folks,
is there a smart way to develop efficiently that helps me in the
following situation: a sub calls a subsub, which calls a subsubsub,
and so on.
Within a subsubsub an error occurs...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |