|
Yes, you appear to have solved the problem of how to create a string variable that will be unusable outside of the 'catch block.
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
|
|
|
|
|
Which is the solution Marc asked for in the OP, n'est-ce pas?
Quote: Look, if you're going to catch an exception, at least give it a variable so in the debugger I can see what the exception is.
If you think 'goto' is evil, try writing an Assembly program without JMP.
|
|
|
|
|
TNCaver wrote: Which is the solution Marc asked for in the OP, n'est-ce pas? Oui
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
|
|
|
|
|
Marc Clifton wrote: Look, if you're going to catch an exception, at least give it a variable so in the debugger I can see what the exception is
At least in the domains in which I work if you "need" to see the exception in a debugger then you "must" log it. Which means there would always be a variable.
|
|
|
|
|
Anything wrong with you adding the necessary exception name, recompiling and running the example again in your debugger. The only problem I can think of is if your code take 3 hours to compile (like one codebase I worked on )
|
|
|
|
|
Job evaluation for each soldier in the Army! (11)
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Performance = Job evaluation
Per = for each
for ce = army
man = soldier
|
|
|
|
|
Well done - and very quick!
You are up tomorrow.
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Thanks... "for each" seems to be used quite often and as soon as I thought of "per" then answer popped straight into my head (maybe because it's a common software term).
It's a nice clue though so I feel bad for ending it so quickly, but hey, I don't manage to solve many so got to take them while I can!
|
|
|
|
|
Seriously, I saw the Post, went for coffee and come back and its done .
More of the story : is bad for CCC
cheers,
Super
------------------------------------------
Too much of good is bad,mix some evil in it
|
|
|
|
|
Grab 'em while you can!
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Foreach? Aren't we meant to use lambdas these days?
Whenever you find yourself on the side of the majority, it is time to pause and reflect. - Mark Twain
|
|
|
|
|
PeejayAdams wrote: Aren't we meant to use lambdas these days?
You mean .ForEach?
List<string> items = new List<string>() { "one", "two", "three" };
items.ForEach(i => Console.WriteLine(i));
I still think the old way is more readable:
List<string> items = new List<string>() { "one", "two", "three" };
foreach (string i in items)
{
Console.WriteLine(i);
}
.ForEach used to be faster (List.ForEach vs foreach(…) | Jon Skeet's coding blog[^]) But collection modification detection was added at .NET 4.5 so that may not be the case anymore.
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
https://assets.amuniversal.com/33945210531101379947005056a9545d[^]
However, to make the task easier, I started to put in typos like 'the the' so they have something to spray - but in any case, I submitted my original.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Pretty much along similar lines.
Why do people still put their names / e-mails / former places of employment etc. in preamble of published software text after intentionally or "accidentally" removing all comments / functions descriptions etc ?
|
|
|
|
|
That happens to me. I'll write a document requested by the field service group. I send it to them. They remove the formatting, copy/paste random sentences, arbitrarily insert spelling errors, and then publish it as final documentation to our customers.
Software Zen: delete this;
|
|
|
|
|
To put a baby alien to sleep, do you rocket?
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Or use a flamethrower?
"If we don't change direction, we'll end up where we're going"
|
|
|
|
|
and if it crashes do you investigate?
I do all my own stunts, but never intentionally!
JaxCoder.com
|
|
|
|
|
No!, no you cover it up and give it it the next Area number available!
|
|
|
|
|
So that's how ET was able to phone home - they gave him the area code.
|
|
|
|
|
Time martian on, but we can still give a nod of approval to that. Zzzzzzz's is certainly as good as any of the other pillow of sunshine we get here.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
You need to feed it first, provided it's not galactose intolerant.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
That one just burst out of you.
Socialism is the Axe Body Spray of political ideologies: It never does what it claims to do, but people too young to know better keep buying it anyway. (Glenn Reynolds)
|
|
|
|
|
ahhh, now I understand what the anal probes are about... to put the eggs in.
Message Signature
(Click to edit ->)
|
|
|
|