VB6 SP6
I have a variable declared as a long. I can assign it a value of 34000 with no problems. However when I try to assign it a sum that equals 34000 I get the overflow error.
For example
I also get the same results in the immediate window with the above code and
How can I overcome this? It seems to be an integer vs. long issue within VB but I just can't see it.
zemp
I have a variable declared as a long. I can assign it a value of 34000 with no problems. However when I try to assign it a sum that equals 34000 I get the overflow error.
For example
Code:
Dim MyLng as Long
MyLong = 34000 ' works
MyLong = 32000 + 2000 'error 6, overflow
Code:
?32000 + 2000
How can I overcome this? It seems to be an integer vs. long issue within VB but I just can't see it.
zemp