views:

25

answers:

1

If I have a double variable that goes through a loop and gets numbers added to it, is it just as simple as saying variablename = 0 to reset it?

Jonesy

+4  A: 

Yes, that will definitely reset the value. You need to think carefully about whether you actually want a double or an integer though - your title says one, and your text says another. In particular, you should almost never treat double values for equality, whereas with integers that's fine. So you wouldn't want

If doubleValue = 10.1 Then

as your condition, but

If integerValue = 10

would be fine.

Jon Skeet
ok thanks, will changing it to variablename = 0.00 be better? It needs to be of type double
iamjonesy
Not needed, @Jonesy. 0 is enough.
rursw1