Click here to Skip to main content
15,889,116 members
Home / Discussions / C#
   

C#

 
GeneralRe: Lessons learned Pin
Kant14-Jun-03 15:06
Kant14-Jun-03 15:06 
GeneralRe: Lessons learned Pin
leppie14-Jun-03 16:21
leppie14-Jun-03 16:21 
GeneralRe: Lessons learned Pin
James T. Johnson14-Jun-03 12:09
James T. Johnson14-Jun-03 12:09 
GeneralRe: Lessons learned Pin
Kant14-Jun-03 15:03
Kant14-Jun-03 15:03 
GeneralRe: Lessons learned Pin
James T. Johnson14-Jun-03 17:03
James T. Johnson14-Jun-03 17:03 
GeneralNew FXCop released Pin
leppie14-Jun-03 1:55
leppie14-Jun-03 1:55 
GeneralRe: New FXCop released Pin
Rocky Moore14-Jun-03 15:33
Rocky Moore14-Jun-03 15:33 
GeneralRe: New FXCop released Pin
leppie14-Jun-03 16:16
leppie14-Jun-03 16:16 
Here's the classic compiler warning:

Say u have an ArrayList with mixed objects, then try test for an empty string like this:

if (arr[2] == "") ...

and it complains that you should cast.
But to most inexperienced programmers will just do:

if ( (string) arr[2] == "") ...

and how now brown cow? Well my opinion.

You should of course do this (i think, i just ignore the warning):

if ( arr[2] as String == "" ) ...

<a TITLE="See my user info" href=http://www.codeproject.com/script/profile/whos_who.asp?id=38829>leppie<a>::<a TITLE="Go to all articles  written by me" href=http://www.codeproject.com/script/articles/list_articles.asp?userid=38829>AllocCPArticle</a>(<a TITLE="Go to my latest, greatest article!" href=http://www.codeproject.com/useritems/dfamachine.asp >Generic DFA State Machine for .NET</a>);

QuestionBrowseForFolder Dialog settings starting Folder? Pin
STW13-Jun-03 19:48
STW13-Jun-03 19:48 
AnswerRe: BrowseForFolder Dialog settings starting Folder? Pin
dynamic13-Jun-03 23:35
dynamic13-Jun-03 23:35 
QuestionIs params a C# keyword? Pin
monrobot1313-Jun-03 12:54
monrobot1313-Jun-03 12:54 
AnswerRe: Is params a C# keyword? Pin
leppie13-Jun-03 13:14
leppie13-Jun-03 13:14 
GeneralOwner-Drawn Scrollbars Pin
J. Dunlap13-Jun-03 12:28
J. Dunlap13-Jun-03 12:28 
GeneralRe: Owner-Drawn Scrollbars Pin
J. Dunlap13-Jun-03 13:55
J. Dunlap13-Jun-03 13:55 
Generalgui event handling Pin
zuhx13-Jun-03 10:08
zuhx13-Jun-03 10:08 
GeneralRe: gui event handling Pin
Paresh Gheewala13-Jun-03 11:22
Paresh Gheewala13-Jun-03 11:22 
Questiondefault (optional) parameters in a function??? Pin
CherezZaboro13-Jun-03 10:06
CherezZaboro13-Jun-03 10:06 
AnswerRe: default (optional) parameters in a function??? Pin
leppie13-Jun-03 10:50
leppie13-Jun-03 10:50 
GeneralC# Language question for a guru Pin
albean13-Jun-03 9:49
albean13-Jun-03 9:49 
GeneralRe: C# Language question for a guru Pin
J. Dunlap13-Jun-03 10:36
J. Dunlap13-Jun-03 10:36 
GeneralOleDbCommands and OleDbDataAdapter Pin
mindfuck13-Jun-03 4:17
mindfuck13-Jun-03 4:17 
GeneralRe: OleDbCommands and OleDbDataAdapter Pin
Laimis13-Jun-03 5:35
Laimis13-Jun-03 5:35 
GeneralText File Reading Newbie Question Pin
Ricardo Kirkner13-Jun-03 3:45
Ricardo Kirkner13-Jun-03 3:45 
GeneralRe: Text File Reading Newbie Question Pin
Jim Stewart13-Jun-03 5:07
Jim Stewart13-Jun-03 5:07 
GeneralRe: Text File Reading Newbie Question Pin
Ricardo Kirkner13-Jun-03 6:20
Ricardo Kirkner13-Jun-03 6:20 

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.