D - exception handling
- imr1984 (3/3) Jan 13 2004 in Handling Errors section in the spec, it doesnt show an example of usi...
- imr1984 (3/6) Jan 13 2004 can someone post an example for using the finally keyword, because C++ d...
- Phill (27/30) Jan 13 2004 You should be able to implement a Singleton pattern
- Phill (5/37) Jan 13 2004 woops wrong thread!
- J C Calvarese (12/15) Jan 13 2004 I probably know less about error handling than you do, so my example may...
in Handling Errors section in the spec, it doesnt show an example of using the try catch finally keywords. Is it somewhere else? Surely that would be the right place to put it.
Jan 13 2004
In article <bu0dkg$1r5t$1 digitaldaemon.com>, imr1984 says...in Handling Errors section in the spec, it doesnt show an example of using the try catch finally keywords. Is it somewhere else? Surely that would be the right place to put it.can someone post an example for using the finally keyword, because C++ doesnt use it.
Jan 13 2004
You should be able to implement a Singleton pattern easy. This is what I do in Java public class One{ One one; public static void getOne(){ if(one == null){ new One(); } } private One(){ // private constructor //construct stuff } } This way if there is an instance of One already you cannot make another One. This was good for me in Java because I found that when clicking a JTable for some reason the Thread goes through the event listener method twice. The Singleton pattern solved this problem for me. Phill. "imr1984" <imr1984_member pathlink.com> wrote in message news:bu0dkg$1r5t$1 digitaldaemon.com...in Handling Errors section in the spec, it doesnt show an example of usingthetry catch finally keywords. Is it somewhere else? Surely that would be therightplace to put it.
Jan 13 2004
woops wrong thread! "Phill" <phill pacific.net.au> wrote in message news:bu20f7$1ff0$1 digitaldaemon.com...You should be able to implement a Singleton pattern easy. This is what I do in Java public class One{ One one; public static void getOne(){ if(one == null){ new One(); } } private One(){ // private constructor //construct stuff } } This way if there is an instance of One already you cannot make another One. This was good for me in Java because I found that when clicking a JTable for some reason the Thread goes through the event listener method twice. The Singleton pattern solved this problem for me. Phill. "imr1984" <imr1984_member pathlink.com> wrote in message news:bu0dkg$1r5t$1 digitaldaemon.com...usingin Handling Errors section in the spec, it doesnt show an example ofthethetry catch finally keywords. Is it somewhere else? Surely that would berightplace to put it.
Jan 13 2004
imr1984 wrote:in Handling Errors section in the spec, it doesnt show an example of using the try catch finally keywords. Is it somewhere else? Surely that would be the right place to put it.I probably know less about error handling than you do, so my example may be of limited use (or wrong). But the attached example does compile and run and it may answer your question. If it doesn't help you, you might try to re-phrase your question. More specific questions get more specific answers. By the way, I'm assuming you've already looked at http://www.digitalmars.com/d/statement.html#try. (I agree it'd be nice to have an actual example in the documentation using these keywords.) -- Justin http://jcc_7.tripod.com/d/
Jan 13 2004