PDA

View Full Version : C Sharp Variable Editing Problem


Blind99
10-30-2009, 04:37 AM
Hey, im currently programming a windows based application using C#.

Here's my problem

Ive got a global variable , name it n_global type double. I wish to edit it using a button. So far so good.

Lets say that the button value 1, the user clicks the button and the variable value becomes 1, but heres the thing, I want the value to be 11 if the user clicks another time.

Dont forget, it cant be a string the variable as to stay a double for later purposes.

Ideas?

oracleguy
10-30-2009, 07:08 AM
Store it as a string and then when you need to use it as a double, just do use the Double.Parse() method to convert it to one.

Or just do some simple math to add to it. (think a multiply and then an add)