Click here to Skip to main content
15,887,746 members
Home / Discussions / C#
   

C#

 
GeneralRe: compile time error or runtime error? Pin
George_George7-May-08 1:27
George_George7-May-08 1:27 
AnswerRe: compile time error or runtime error? Pin
Daniel Grunwald4-May-08 4:31
Daniel Grunwald4-May-08 4:31 
GeneralRe: compile time error or runtime error? Pin
George_George4-May-08 4:36
George_George4-May-08 4:36 
GeneralRe: compile time error or runtime error? Pin
Daniel Grunwald4-May-08 4:56
Daniel Grunwald4-May-08 4:56 
GeneralRe: compile time error or runtime error? Pin
George_George4-May-08 18:33
George_George4-May-08 18:33 
GeneralRe: compile time error or runtime error? Examples Pin
Daniel Grunwald4-May-08 5:03
Daniel Grunwald4-May-08 5:03 
GeneralRe: compile time error or runtime error? Examples Pin
George_George4-May-08 18:38
George_George4-May-08 18:38 
GeneralRe: compile time error or runtime error? Pin
#realJSOP4-May-08 6:40
mve#realJSOP4-May-08 6:40 
What you did is perfectly okay with the compiler (sometimes you can't rely on automated systems - you simply have to "do it right"). If you had used the correct casting mechanism, it would have been fine. I almost never use (long)varName to cast. Instead, I use Convert.ToIn32(varName), which in your case would have yielded the expected value (100).

One other thing to remember - ALWAYS put a try/catch block around a Convert method, even if you simply eat the exception. You don't want your app crashing ungracefully.


"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001


GeneralRe: compile time error or runtime error? Pin
George_George4-May-08 18:41
George_George4-May-08 18:41 
GeneralRe: compile time error or runtime error? Pin
#realJSOP5-May-08 2:47
mve#realJSOP5-May-08 2:47 
GeneralRe: compile time error or runtime error? Pin
Guffa5-May-08 10:33
Guffa5-May-08 10:33 
GeneralRe: compile time error or runtime error? Pin
George_George7-May-08 1:29
George_George7-May-08 1:29 
AnswerRe: compile time error or runtime error? Pin
Charith Jayasundara4-May-08 8:04
Charith Jayasundara4-May-08 8:04 
GeneralRe: compile time error or runtime error? Pin
George_George4-May-08 18:46
George_George4-May-08 18:46 
QuestionNumbers Don't Display According To The Current Culture! Pin
WaleedH3-May-08 23:21
WaleedH3-May-08 23:21 
QuestionDateTime Hour Minute Question Pin
MumbleB3-May-08 22:38
MumbleB3-May-08 22:38 
AnswerRe: DateTime Hour Minute Question Pin
MumbleB3-May-08 22:42
MumbleB3-May-08 22:42 
GeneralRe: DateTime Hour Minute Question Pin
Luc Pattyn3-May-08 23:07
sitebuilderLuc Pattyn3-May-08 23:07 
GeneralRe: DateTime Hour Minute Question Pin
MumbleB3-May-08 23:45
MumbleB3-May-08 23:45 
GeneralRe: DateTime Hour Minute Question [modified] Pin
#realJSOP4-May-08 3:53
mve#realJSOP4-May-08 3:53 
GeneralRe: DateTime Hour Minute Question Pin
PIEBALDconsult4-May-08 5:55
mvePIEBALDconsult4-May-08 5:55 
GeneralRe: DateTime Hour Minute Question Pin
Luc Pattyn4-May-08 11:40
sitebuilderLuc Pattyn4-May-08 11:40 
QuestionCPU and RAM Usage Pin
Ian Uy3-May-08 19:44
Ian Uy3-May-08 19:44 
AnswerRe: CPU and RAM Usage Pin
MumbleB3-May-08 22:13
MumbleB3-May-08 22:13 
QuestionOutput to word? Pin
Muammar©3-May-08 19:40
Muammar©3-May-08 19:40 

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.