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

C#

 
GeneralRe: Newbie: if/else Pin
OriginalGriff30-Apr-19 4:30
protectorOriginalGriff30-Apr-19 4:30 
GeneralRe: Newbie: if/else Pin
Richard MacCutchan30-Apr-19 5:47
protectorRichard MacCutchan30-Apr-19 5:47 
GeneralRe: Newbie: if/else Pin
OriginalGriff30-Apr-19 5:52
protectorOriginalGriff30-Apr-19 5:52 
GeneralRe: Newbie: if/else Pin
Richard MacCutchan30-Apr-19 6:02
protectorRichard MacCutchan30-Apr-19 6:02 
GeneralRe: Newbie: if/else Pin
OriginalGriff30-Apr-19 6:28
protectorOriginalGriff30-Apr-19 6:28 
GeneralRe: Newbie: if/else Pin
Richard MacCutchan30-Apr-19 21:32
protectorRichard MacCutchan30-Apr-19 21:32 
AnswerRe: Newbie: if/else Pin
BillWoodruff30-Apr-19 18:07
mveBillWoodruff30-Apr-19 18:07 
AnswerRe: Newbie: if/else Pin
David A. Gray3-May-19 7:40
groupDavid A. Gray3-May-19 7:40 
Quote:
if(input = "stop"


I suspect you are coming over from Visual Basic, in which the equality test is pretty much the way you wrote it. In C#, the equality operator is ==. Hence, your snippet should be as follows.
f(input == "stop")
                {
                    Console.WriteLine(result);
                }
                else
                {
                    converted = Convert.ToInt32(input);
                    result = result + converted;

<pre>
            }</pre>
David A. Gray
Delivering Solutions for the Ages, One Problem at a Time
Interpreting the Fundamental Principle of Tabular Reporting

QuestionRound Corner in C# windows foam application Pin
Member 1434920730-Apr-19 1:20
memberMember 1434920730-Apr-19 1:20 
AnswerRe: Round Corner in C# windows foam application Pin
Eddy Vluggen30-Apr-19 1:27
mveEddy Vluggen30-Apr-19 1:27 
GeneralRe: Round Corner in C# windows foam application Pin
BillWoodruff30-Apr-19 18:42
mveBillWoodruff30-Apr-19 18:42 
GeneralRe: Round Corner in C# windows foam application Pin
Eddy Vluggen1-May-19 1:03
mveEddy Vluggen1-May-19 1:03 
AnswerRe: Round Corner in C# windows foam application Pin
Gerry Schmitz30-Apr-19 1:56
mveGerry Schmitz30-Apr-19 1:56 
AnswerRe: Round Corner in C# windows foam application Pin
BillWoodruff30-Apr-19 18:40
mveBillWoodruff30-Apr-19 18:40 
QuestionHow to get the MaxValue using LINQ ?! Pin
Abdalla Ben Omran29-Apr-19 2:24
memberAbdalla Ben Omran29-Apr-19 2:24 
AnswerRe: How to get the MaxValue using LINQ ?! Pin
OriginalGriff29-Apr-19 3:00
protectorOriginalGriff29-Apr-19 3:00 
GeneralRe: How to get the MaxValue using LINQ ?! Pin
Abdalla Ben Omran29-Apr-19 3:17
memberAbdalla Ben Omran29-Apr-19 3:17 
GeneralRe: How to get the MaxValue using LINQ ?! Pin
OriginalGriff29-Apr-19 3:55
protectorOriginalGriff29-Apr-19 3:55 
GeneralRe: How to get the MaxValue using LINQ ?! Pin
Richard Deeming1-May-19 8:22
mveRichard Deeming1-May-19 8:22 
AnswerRe: How to get the MaxValue using LINQ ?! Pin
Dave Kreskowiak29-Apr-19 3:10
mveDave Kreskowiak29-Apr-19 3:10 
AnswerRe: How to get the MaxValue using LINQ ?! Pin
Maciej Los29-Apr-19 9:04
protectorMaciej Los29-Apr-19 9:04 
GeneralRe: How to get the MaxValue using LINQ ?! Pin
OriginalGriff29-Apr-19 20:14
protectorOriginalGriff29-Apr-19 20:14 
PraiseRe: How to get the MaxValue using LINQ ?! Pin
Maciej Los29-Apr-19 20:29
protectorMaciej Los29-Apr-19 20:29 
GeneralRe: How to get the MaxValue using LINQ ?! Pin
OriginalGriff29-Apr-19 20:42
protectorOriginalGriff29-Apr-19 20:42 
GeneralRe: How to get the MaxValue using LINQ ?! Pin
Luc Pattyn30-Apr-19 0:37
professionalLuc Pattyn30-Apr-19 0:37 

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.