Click here to Skip to main content
14,328,470 members
   

C#

 
GeneralRe: Does Anybody Else Miss the WITH construct of Visual Basic? Pin
#realJSOP18-May-19 1:07
mve#realJSOP18-May-19 1:07 
AnswerRe: Does Anybody Else Miss the WITH construct of Visual Basic? Pin
OriginalGriff17-May-19 7:56
protectorOriginalGriff17-May-19 7:56 
GeneralRe: Does Anybody Else Miss the WITH construct of Visual Basic? Pin
David A. Gray17-May-19 8:00
groupDavid A. Gray17-May-19 8:00 
GeneralRe: Does Anybody Else Miss the WITH construct of Visual Basic? Pin
OriginalGriff17-May-19 8:16
protectorOriginalGriff17-May-19 8:16 
GeneralRe: Does Anybody Else Miss the WITH construct of Visual Basic? Pin
David A. Gray17-May-19 8:19
groupDavid A. Gray17-May-19 8:19 
GeneralRe: Does Anybody Else Miss the WITH construct of Visual Basic? Pin
Dave Kreskowiak17-May-19 9:08
mveDave Kreskowiak17-May-19 9:08 
JokeRe: Does Anybody Else Miss the WITH construct of Visual Basic? Pin
Richard Deeming17-May-19 9:24
mveRichard Deeming17-May-19 9:24 
GeneralRe: Does Anybody Else Miss the WITH construct of Visual Basic? Pin
OriginalGriff17-May-19 9:29
protectorOriginalGriff17-May-19 9:29 
I can see what they are trying to do - scope the variable to just the code where the result is actually valid:
{
int result;
if (int.TryParse(input, out result))
    Console.WriteLine(result);
else
    Console.WriteLine("Could not parse input");
}
Only it's out of scope in the else block.

And that does make some good sense.
But it is ugly - I'll get used to it and it should improve reliability in the long term.
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!

GeneralRe: Does Anybody Else Miss the WITH construct of Visual Basic? Pin
Dave Kreskowiak17-May-19 9:35
mveDave Kreskowiak17-May-19 9:35 
GeneralRe: Does Anybody Else Miss the WITH construct of Visual Basic? Pin
BillWoodruff17-May-19 15:11
mveBillWoodruff17-May-19 15:11 
GeneralRe: Does Anybody Else Miss the WITH construct of Visual Basic? Pin
Dave Kreskowiak17-May-19 15:55
mveDave Kreskowiak17-May-19 15:55 
GeneralRe: Does Anybody Else Miss the WITH construct of Visual Basic? Pin
phil.o18-May-19 5:43
mvephil.o18-May-19 5:43 
GeneralRe: Does Anybody Else Miss the WITH construct of Visual Basic? Pin
David A. Gray18-May-19 11:05
groupDavid A. Gray18-May-19 11:05 
GeneralRe: Does Anybody Else Miss the WITH construct of Visual Basic? Pin
phil.o18-May-19 21:52
mvephil.o18-May-19 21:52 
AnswerRe: Does Anybody Else Miss the WITH construct of Visual Basic? Pin
Gerry Schmitz17-May-19 15:17
mveGerry Schmitz17-May-19 15:17 
AnswerRe: Does Anybody Else Miss the WITH construct of Visual Basic? Pin
BillWoodruff17-May-19 15:45
mveBillWoodruff17-May-19 15:45 
GeneralRe: Does Anybody Else Miss the WITH construct of Visual Basic? Pin
David A. Gray17-May-19 16:43
groupDavid A. Gray17-May-19 16:43 
GeneralRe: Does Anybody Else Miss the WITH construct of Visual Basic? Pin
BillWoodruff17-May-19 17:41
mveBillWoodruff17-May-19 17:41 
GeneralRe: Does Anybody Else Miss the WITH construct of Visual Basic? Pin
David A. Gray18-May-19 11:16
groupDavid A. Gray18-May-19 11:16 
GeneralRe: Does Anybody Else Miss the WITH construct of Visual Basic? Pin
BillWoodruff18-May-19 18:02
mveBillWoodruff18-May-19 18:02 
GeneralRe: Does Anybody Else Miss the WITH construct of Visual Basic? Pin
David A. Gray20-May-19 9:15
groupDavid A. Gray20-May-19 9:15 
GeneralRe: Does Anybody Else Miss the WITH construct of Visual Basic? Pin
BillWoodruff20-May-19 17:17
mveBillWoodruff20-May-19 17:17 
GeneralRe: Does Anybody Else Miss the WITH construct of Visual Basic? Pin
OriginalGriff17-May-19 21:20
protectorOriginalGriff17-May-19 21:20 
GeneralRe: Does Anybody Else Miss the WITH construct of Visual Basic? Pin
#realJSOP18-May-19 1:10
mve#realJSOP18-May-19 1:10 
AnswerRe: Does Anybody Else Miss the WITH construct of Visual Basic? Pin
Jörgen Andersson17-May-19 20:04
protectorJörgen Andersson17-May-19 20:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.