Click here to Skip to main content
15,891,567 members
Home / Discussions / C#
   

C#

 
GeneralRe: Dynamically assign values to instance Pin
Stevo Z16-Feb-09 1:52
Stevo Z16-Feb-09 1:52 
GeneralRe: Dynamically assign values to instance Pin
Calin Tatar16-Feb-09 1:54
Calin Tatar16-Feb-09 1:54 
GeneralRe: Dynamically assign values to instance Pin
Calin Tatar17-Feb-09 2:33
Calin Tatar17-Feb-09 2:33 
Questiongoogle maps within windows application Pin
laziale16-Feb-09 0:14
laziale16-Feb-09 0:14 
AnswerRe: google maps within windows application Pin
musefan16-Feb-09 0:28
musefan16-Feb-09 0:28 
QuestionSingle Line Calculator. How do I? Pin
Wogboiii16-Feb-09 0:12
Wogboiii16-Feb-09 0:12 
AnswerRe: Single Line Calculator. How do I? Pin
Calin Tatar16-Feb-09 0:19
Calin Tatar16-Feb-09 0:19 
AnswerRe: Single Line Calculator. How do I? Pin
musefan16-Feb-09 0:21
musefan16-Feb-09 0:21 
first get the input line as a string

then remove all spaces so you get something like 47+23

then split the string based on the valid operators i.e. + - * /

you will need to also store them in an array

so then you should have two string arrays i.e values[] and operators[]

then you can do a loop for each value

int result = int.Parse(values[0]);//will be your result
for(int i = 1; i < values.Length; i++)
{
string op = operators[i-1];
int val = values[i];
switch(op){
case "+":
result += val;
break;
case "-":
result -= val;
break;
...//and so on
}

}

this is just an idea of the top of my head, the logic is there so it should work but you will need to handle error checking and also the calculation will be done in order of appearence rather than operator priority i.e. 2 + 5 * 7 would equal 49 not 37

If only MySelf.Visible was more than just a getter...

A person can produce over 5 times there own body weight in excrement each year... please re-read your questions before posting

GeneralRe: Single Line Calculator. How do I? Pin
Calin Tatar16-Feb-09 0:36
Calin Tatar16-Feb-09 0:36 
AnswerRe: Single Line Calculator. How do I? Pin
PIEBALDconsult16-Feb-09 5:23
mvePIEBALDconsult16-Feb-09 5:23 
QuestionSetting a property value if an event handler method is attached in design time property editor Pin
Nadia Monalisa15-Feb-09 23:41
Nadia Monalisa15-Feb-09 23:41 
AnswerRe: Setting a property value if an event handler method is attached in design time property editor Pin
Calin Tatar16-Feb-09 0:07
Calin Tatar16-Feb-09 0:07 
GeneralRe: Setting a property value if an event handler method is attached in design time property editor Pin
Nadia Monalisa16-Feb-09 0:12
Nadia Monalisa16-Feb-09 0:12 
QuestionIs it possible to convert XMLNode to Treenode Pin
Gonxh Aniket15-Feb-09 23:31
Gonxh Aniket15-Feb-09 23:31 
AnswerRe: Is it possible to convert XMLNode to Treenode Pin
Calin Tatar15-Feb-09 23:39
Calin Tatar15-Feb-09 23:39 
GeneralRe: Is it possible to convert XMLNode to Treenode Pin
Calin Tatar15-Feb-09 23:46
Calin Tatar15-Feb-09 23:46 
GeneralRe: Is it possible to convert XMLNode to Treenode Pin
Gonxh Aniket16-Feb-09 0:50
Gonxh Aniket16-Feb-09 0:50 
QuestionCopying a file from one system to another Pin
arun_pk15-Feb-09 23:09
arun_pk15-Feb-09 23:09 
AnswerRe: Copying a file from one system to another Pin
Vikram A Punathambekar15-Feb-09 23:33
Vikram A Punathambekar15-Feb-09 23:33 
QuestionRe: Copying a file from one system to another Pin
arun_pk15-Feb-09 23:48
arun_pk15-Feb-09 23:48 
AnswerRe: Copying a file from one system to another Pin
Vikram A Punathambekar16-Feb-09 0:47
Vikram A Punathambekar16-Feb-09 0:47 
QuestionC# :: Updating SQL Table Form DataGridView :: Repost Pin
WinSolution15-Feb-09 23:08
WinSolution15-Feb-09 23:08 
Questionstring question Pin
bar300015-Feb-09 23:05
bar300015-Feb-09 23:05 
AnswerRe: string question Pin
WinSolution15-Feb-09 23:16
WinSolution15-Feb-09 23:16 
AnswerRe: string question Pin
arun_pk15-Feb-09 23:16
arun_pk15-Feb-09 23:16 

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.